redux: fixed bugs

This commit is contained in:
muerwre 2018-11-26 17:40:49 +07:00
parent 0f3217f5df
commit 5d14a753f7
6 changed files with 20 additions and 31 deletions

View file

@ -244,7 +244,6 @@ export class Editor {
};
startEditing = () => {
console.log('ED START');
const { path } = getUrlData();
const { random_url, id } = this.getUser();
@ -257,13 +256,9 @@ export class Editor {
if (this.poly.latlngs && this.poly.latlngs.length > 1) this.poly.poly.enableEdit();
this.stickers.startEditing();
// this.setEditing(true);
// console.log(this.initialData);
};
stopEditing = () => {
console.log('ED STOP');
const { path } = getUrlData();
pushPath(`/${(this.initialData && this.initialData.path) || path}`);
@ -274,20 +269,14 @@ export class Editor {
};
cancelEditing = () => {
this.stopEditing();
console.log('trying to set initial data');
if (this.hasEmptyHistory()) {
console.log('empty history');
this.clearAll();
this.startEditing();
} else {
console.log('setting initial');
this.setData(this.initialData);
console.log('setting initial - done');
}
this.stopEditing();
this.clearChanged();
return true;

View file

@ -57,9 +57,9 @@ export class Stickers {
startEditing = () => {
this.stickers.map(sticker => sticker.startEditing());
}
};
stopEditing = () => {
this.stickers.map(sticker => sticker.stopEditing());
}
};
}