mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
editor: fixed editing cancelation on empty history
This commit is contained in:
parent
72340ae428
commit
9e186397e0
2 changed files with 7 additions and 5 deletions
|
@ -122,7 +122,6 @@ export class Router {
|
|||
};
|
||||
|
||||
submitDrawing = () => {
|
||||
console.log('ROUT', this.router);
|
||||
const [route] = this.router._routes;
|
||||
if (!route) return;
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue