routes: refreshing map list on login/logout

This commit is contained in:
muerwre 2018-12-13 17:35:52 +07:00
parent e4894c7767
commit a3b04173d0

View file

@ -202,11 +202,6 @@ function* setModeSaga({ mode }) {
// console.log('change', mode); // console.log('change', mode);
} }
function* userLogoutSaga() {
yield put(setUser(DEFAULT_USER));
yield call(generateGuestSaga);
}
function* setActiveStickerSaga({ activeSticker }) { function* setActiveStickerSaga({ activeSticker }) {
yield editor.activeSticker = activeSticker; yield editor.activeSticker = activeSticker;
yield put(setMode(MODES.STICKERS)); yield put(setMode(MODES.STICKERS));
@ -499,6 +494,19 @@ function* setSaveSuccessSaga({ address, title }) {
return yield editor.setInitialData(); return yield editor.setInitialData();
} }
function* userLogoutSaga() {
yield put(setUser(DEFAULT_USER));
yield call(generateGuestSaga);
}
function* setUserSaga() {
const { dialog_active } = yield select(getState);
if (dialog_active) yield call(searchSetSagaWorker);
return true;
}
export function* userSaga() { export function* userSaga() {
yield takeLatest(REHYDRATE, authCheckSaga); yield takeLatest(REHYDRATE, authCheckSaga);
yield takeEvery(ACTIONS.SET_MODE, setModeSaga); yield takeEvery(ACTIONS.SET_MODE, setModeSaga);
@ -539,4 +547,5 @@ export function* userSaga() {
yield takeLatest(ACTIONS.OPEN_MAP_DIALOG, openMapDialogSaga); yield takeLatest(ACTIONS.OPEN_MAP_DIALOG, openMapDialogSaga);
yield takeLatest(ACTIONS.SEARCH_SET_TAB, searchSetTabSaga); yield takeLatest(ACTIONS.SEARCH_SET_TAB, searchSetTabSaga);
yield takeLatest(ACTIONS.SET_USER, setUserSaga);
} }