mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
route: fixed empty route cancellation
This commit is contained in:
parent
095c7cf946
commit
516bcbca05
2 changed files with 4 additions and 2 deletions
|
@ -283,18 +283,19 @@ export class Editor {
|
||||||
|
|
||||||
stopEditing = () => {
|
stopEditing = () => {
|
||||||
const { path } = getUrlData();
|
const { path } = getUrlData();
|
||||||
|
|
||||||
pushPath(`/${(this.initialData && this.initialData.path) || path}`);
|
pushPath(`/${(this.initialData && this.initialData.path) || path}`);
|
||||||
|
|
||||||
// this.changeMode(MODES.NONE);
|
|
||||||
this.poly.poly.disableEdit();
|
this.poly.poly.disableEdit();
|
||||||
this.stickers.stopEditing();
|
this.stickers.stopEditing();
|
||||||
// this.setEditing(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cancelEditing = () => {
|
cancelEditing = () => {
|
||||||
if (this.hasEmptyHistory) {
|
if (this.hasEmptyHistory) {
|
||||||
this.clearAll();
|
this.clearAll();
|
||||||
this.startEditing();
|
this.startEditing();
|
||||||
|
this.clearChanged();
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.setData(this.initialData);
|
this.setData(this.initialData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ function* stopEditingSaga() {
|
||||||
}
|
}
|
||||||
|
|
||||||
yield editor.cancelEditing();
|
yield editor.cancelEditing();
|
||||||
|
|
||||||
yield put(setMode(MODES.NONE));
|
yield put(setMode(MODES.NONE));
|
||||||
|
|
||||||
yield put(setChanged(false));
|
yield put(setChanged(false));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue