mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
redux: router fixed
This commit is contained in:
parent
5d2c534aa9
commit
eb5b0e5d28
6 changed files with 98 additions and 39 deletions
|
@ -16,3 +16,6 @@ export const setAddress = address => ({ type: ACTIONS.SET_ADDRESS, address });
|
|||
|
||||
export const startEditing = () => ({ type: ACTIONS.START_EDITING });
|
||||
export const stopEditing = () => ({ type: ACTIONS.STOP_EDITING });
|
||||
|
||||
export const routerCancel = () => ({ type: ACTIONS.ROUTER_CANCEL });
|
||||
export const routerSubmit = () => ({ type: ACTIONS.ROUTER_SUBMIT });
|
||||
|
|
|
@ -14,4 +14,7 @@ export const ACTIONS = {
|
|||
|
||||
START_EDITING: 'START_EDITING',
|
||||
STOP_EDITING: 'STOP_EDITING',
|
||||
|
||||
ROUTER_CANCEL: 'ROUTER_CANCEL',
|
||||
ROUTER_SUBMIT: 'ROUTER_SUBMIT',
|
||||
};
|
||||
|
|
|
@ -127,6 +127,20 @@ function* setLogoSaga({ logo }) {
|
|||
}
|
||||
}
|
||||
|
||||
function* routerCancelSaga() {
|
||||
yield call(editor.router.cancelDrawing);
|
||||
yield put(setMode(MODES.NONE));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function* routerSubmitSaga() {
|
||||
yield call(editor.router.submitDrawing);
|
||||
yield put(setMode(MODES.NONE));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
export function* userSaga() {
|
||||
// ASYNCHRONOUS!!! :-)
|
||||
|
||||
|
@ -139,4 +153,7 @@ export function* userSaga() {
|
|||
yield takeEvery(ACTIONS.USER_LOGOUT, userLogoutSaga);
|
||||
yield takeEvery(ACTIONS.SET_ACTIVE_STICKER, setActiveStickerSaga);
|
||||
yield takeEvery(ACTIONS.SET_LOGO, setLogoSaga);
|
||||
|
||||
yield takeEvery(ACTIONS.ROUTER_CANCEL, routerCancelSaga);
|
||||
yield takeEvery(ACTIONS.ROUTER_SUBMIT, routerSubmitSaga);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue