mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-05-06 16:36:40 +07:00
stickers stops dragging
This commit is contained in:
parent
fca52df9f5
commit
58eefd5670
10 changed files with 388 additions and 175 deletions
src/redux
|
@ -2,14 +2,18 @@ import { createReducer } from 'reduxsauce';
|
|||
import { MAP_HANDLERS } from './handlers';
|
||||
import { DEFAULT_PROVIDER } from '$constants/providers';
|
||||
import { IMapRoute } from './types';
|
||||
import { IStickerDump } from '$modules/Sticker';
|
||||
|
||||
export interface IMapReducer {
|
||||
provider: string;
|
||||
route: IMapRoute;
|
||||
stickers: IStickerDump[]
|
||||
}
|
||||
|
||||
export const MAP_INITIAL_STATE = {
|
||||
provider: DEFAULT_PROVIDER,
|
||||
route: [],
|
||||
stickers: [],
|
||||
}
|
||||
|
||||
export const map = createReducer(MAP_INITIAL_STATE, MAP_HANDLERS)
|
|
@ -1,2 +1,5 @@
|
|||
export const selectMapProvider = state => state.map.provider;
|
||||
export const selectMapRoute= state => state.map.route;
|
||||
import { IState } from "$redux/store";
|
||||
|
||||
export const selectMapProvider = (state: IState) => state.map.provider;
|
||||
export const selectMapRoute= (state: IState) => state.map.route;
|
||||
export const selectMapStickers = (state: IState) => state.map.stickers;
|
|
@ -157,8 +157,6 @@ 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);
|
||||
|
@ -172,6 +170,7 @@ function* loadMapSaga(path) {
|
|||
yield put(mapSet({
|
||||
provider: route.provider,
|
||||
route: route.route,
|
||||
stickers: route.stickers,
|
||||
}))
|
||||
|
||||
return { route, random_url };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue