editor: fixed editing cancelation on empty history

This commit is contained in:
muerwre 2018-11-27 09:23:38 +07:00
parent 72340ae428
commit 9e186397e0
2 changed files with 7 additions and 5 deletions

View file

@ -122,7 +122,6 @@ export class Router {
};
submitDrawing = () => {
console.log('ROUT', this.router);
const [route] = this.router._routes;
if (!route) return;

View file

@ -28,15 +28,15 @@ function* generateGuestSaga() {
function* startEmptyEditorSaga() {
const { id, random_url } = yield select(getUser);
console.log('RURL', random_url);
pushPath(`/${random_url}/edit`);
editor.owner = id;
editor.startEditing();
return hideLoader();
yield put(setChanged(false));
yield put(setEditing(true));
// todo: this.clearChanged();
return hideLoader();
}
function* startEditingSaga() {
@ -54,8 +54,11 @@ function* stopEditingSaga() {
}
yield editor.cancelEditing();
yield put(setEditing(false));
yield put(setMode(MODES.NONE));
yield put(setChanged(false));
yield put(setEditing(editor.hasEmptyHistory())); // don't close editor if no previous map
}
function* mapInitSaga() {