From e4894c77676f52f73e27e666093239c7e2e28205 Mon Sep 17 00:00:00 2001 From: muerwre Date: Thu, 13 Dec 2018 17:28:01 +0700 Subject: [PATCH] routes: refreshing map list on save --- src/redux/user/sagas.js | 35 +++++++++++++++++++---------------- src/styles/dialogs.less | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/redux/user/sagas.js b/src/redux/user/sagas.js index 4fdfadc..3a2ed39 100644 --- a/src/redux/user/sagas.js +++ b/src/redux/user/sagas.js @@ -292,22 +292,6 @@ function* refreshUserData() { return yield put(setUser(data)); } -function* setSaveSuccessSaga({ address, title }) { - const { id } = yield select(getUser); - - replacePath(`/${address}/edit`); - - yield put(setTitle(title)); - yield put(setAddress(address)); - yield put(setChanged(false)); - - yield editor.owner = { id }; - - yield call(refreshUserData); - - return yield editor.setInitialData(); -} - function* getRenderData() { yield put(setRenderer({ info: 'Загрузка тайлов', progress: 0.1 })); @@ -496,6 +480,25 @@ function* searchSetTabSaga() { yield call(searchSetSaga); } +function* setSaveSuccessSaga({ address, title }) { + const { id } = yield select(getUser); + const { dialog_active } = yield select(getState); + + replacePath(`/${address}/edit`); + + yield put(setTitle(title)); + yield put(setAddress(address)); + yield put(setChanged(false)); + + yield editor.owner = { id }; + + if (dialog_active) { + yield call(searchSetSagaWorker); + } + + return yield editor.setInitialData(); +} + export function* userSaga() { yield takeLatest(REHYDRATE, authCheckSaga); yield takeEvery(ACTIONS.SET_MODE, setModeSaga); diff --git a/src/styles/dialogs.less b/src/styles/dialogs.less index 042f31a..6d7d408 100644 --- a/src/styles/dialogs.less +++ b/src/styles/dialogs.less @@ -180,7 +180,7 @@ opacity: 0.3; margin-bottom: 5px; display: grid; - grid-template-columns: 2fr 1fr 1fr; + grid-template-columns: 2fr 1fr; svg { width: 20px;