Component saving timeouts
This commit is contained in:
@@ -382,12 +382,19 @@ angular.module('app.frontend')
|
|||||||
|
|
||||||
else if(action === "save-items" || action === "save-success" || action == "save-error") {
|
else if(action === "save-items" || action === "save-success" || action == "save-error") {
|
||||||
if(data.items.map((item) => {return item.uuid}).includes(this.note.uuid)) {
|
if(data.items.map((item) => {return item.uuid}).includes(this.note.uuid)) {
|
||||||
|
|
||||||
if(action == "save-items") {
|
if(action == "save-items") {
|
||||||
this.showSavingStatus();
|
if(this.componentSaveTimeout) $timeout.cancel(this.componentSaveTimeout);
|
||||||
} else if(action == "save-success") {
|
this.componentSaveTimeout = $timeout(this.showSavingStatus.bind(this), 10);
|
||||||
$timeout(this.showAllChangesSavedStatus.bind(this), 200);
|
}
|
||||||
} else {
|
|
||||||
$timeout(this.showErrorStatus.bind(this), 200);
|
else {
|
||||||
|
if(this.componentStatusTimeout) $timeout.cancel(this.componentStatusTimeout);
|
||||||
|
if(action == "save-success") {
|
||||||
|
this.componentStatusTimeout = $timeout(this.showAllChangesSavedStatus.bind(this), 400);
|
||||||
|
} else {
|
||||||
|
this.componentStatusTimeout = $timeout(this.showErrorStatus.bind(this), 400);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user