Bugfix: saveError undefined, should be serverError

Bugfix: dot should be comma
This commit is contained in:
djmaze 2021-01-20 12:04:27 +01:00
parent ca91a6e408
commit d9118fbf90
3 changed files with 15 additions and 14 deletions

View file

@ -82,8 +82,8 @@ class FiltersUserSettings {
this.scripts.remove(script);
delegateRunOnDestroy(script);
} else {
this.saveError(true);
this.saveErrorText((data && data.ErrorCode)
this.serverError(true);
this.serverErrorDesc((data && data.ErrorCode)
? (data.ErrorMessageAdditional || getNotification(data.ErrorCode))
: getNotification(Notification.CantActivateFiltersScript)
);
@ -101,8 +101,8 @@ class FiltersUserSettings {
if (StorageResultType.Success === result && data && data.Result) {
this.scripts().forEach(script => script.active(script.name() === name));
} else {
this.saveError(true);
this.saveErrorText((data && data.ErrorCode)
this.serverError(true);
this.serverErrorDesc((data && data.ErrorCode)
? (data.ErrorMessageAdditional || getNotification(data.ErrorCode))
: getNotification(Notification.CantActivateFiltersScript)
);

View file

@ -36,8 +36,9 @@ class SieveScriptPopupView extends AbstractViewNext {
// @command()
saveScriptCommand() {
let script = this.script();
if (!this.saving/* && script.hasChanges()*/) {
let self = this,
script = self.script();
if (!self.saving/* && script.hasChanges()*/) {
if (!script.verify()) {
return false;
}
@ -47,21 +48,21 @@ class SieveScriptPopupView extends AbstractViewNext {
return false;
}
this.saving = true;
this.saveError(false);
self.saving = true;
self.saveError(false);
// script.body(script.filtersToRaw());
Remote.filtersScriptSave(
(result, data) => {
this.saving = false;
self.saving = false;
if (StorageResultType.Success === result && data && data.Result) {
script.exists(true);
script.hasChanges(false);
SieveStore.scripts.push(script);
} else {
this.saveError(true);
this.saveErrorText((data && data.ErrorCode)
self.saveError(true);
self.saveErrorText((data && data.ErrorCode)
? (data.ErrorMessageAdditional || getNotification(data.ErrorCode))
: getNotification(Notification.CantSaveFilters)
);