mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
added editable route
This commit is contained in:
parent
5664291c92
commit
fca52df9f5
17 changed files with 282 additions and 11 deletions
|
@ -89,6 +89,7 @@ import { IRootState } from "$redux/user";
|
|||
import { downloadGPXTrack, getGPXString } from "$utils/gpx";
|
||||
import { Unwrap } from "$utils/middleware";
|
||||
import { IState } from "$redux/store";
|
||||
import { mapSetProvider, mapSet } from "$redux/map/actions";
|
||||
|
||||
const getUser = (state: IState) => state.user.user;
|
||||
const getState = (state: IState) => state.user;
|
||||
|
@ -156,6 +157,8 @@ function* loadMapSaga(path) {
|
|||
data: { route, error, random_url }
|
||||
}: Unwrap<typeof getStoredMap> = yield call(getStoredMap, { name: path });
|
||||
|
||||
console.log({ route });
|
||||
|
||||
if (route && !error) {
|
||||
yield editor.clearAll();
|
||||
yield editor.setData(route);
|
||||
|
@ -164,6 +167,13 @@ function* loadMapSaga(path) {
|
|||
|
||||
yield put(setChanged(false));
|
||||
|
||||
// TODO: REACTIVE BRANCH:
|
||||
// yield put(mapSetProvider(route.provider));
|
||||
yield put(mapSet({
|
||||
provider: route.provider,
|
||||
route: route.route,
|
||||
}))
|
||||
|
||||
return { route, random_url };
|
||||
}
|
||||
|
||||
|
@ -529,6 +539,9 @@ function* changeProviderSaga({
|
|||
|
||||
yield put(setProvider(provider));
|
||||
|
||||
// TODO: REACTIVE BRANCH
|
||||
yield put(mapSetProvider(provider))
|
||||
|
||||
if (current_provider === provider) return;
|
||||
|
||||
yield put(setChanged(true));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue