setting changed on actual map change

This commit is contained in:
Fedor Katurov 2020-01-14 10:47:25 +07:00
parent 34f98fb08b
commit 1a00b98ba3
3 changed files with 17 additions and 8 deletions

View file

@ -313,7 +313,16 @@ function* sendSaveRequestSaga({
);
}
function* setChanged() {
const { changed } = yield select(selectEditor);
if (changed) return;
yield put(editorSetChanged(true));
}
export function* mapSaga() {
yield takeEvery([MAP_ACTIONS.SET_ROUTE, MAP_ACTIONS.SET_STICKER], setChanged);
// TODO: setChanged on set route, logo, provider, stickers
yield takeEvery(EDITOR_ACTIONS.START_EDITING, startEditingSaga);
yield takeEvery(EDITOR_ACTIONS.SET_ACTIVE_STICKER, setActiveStickerSaga);