mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Set response ErrorCode as iError for easier fetch error handling
This commit is contained in:
parent
a46c0c3b21
commit
11fd6736bb
24 changed files with 145 additions and 253 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { Notification } from 'Common/Enums';
|
||||
import { getNotification, i18nToNodes } from 'Common/Translator';
|
||||
import { addObservablesTo } from 'Common/Utils';
|
||||
import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
||||
|
|
@ -61,16 +60,13 @@ class SieveScriptPopupView extends AbstractViewPopup {
|
|||
(iError, data) => {
|
||||
self.saving = false;
|
||||
|
||||
if (!iError && data && data.Result) {
|
||||
if (iError) {
|
||||
self.saveError(true);
|
||||
self.saveErrorText((data && data.ErrorMessageAdditional) || getNotification(iError));
|
||||
} else {
|
||||
script.exists() || SieveUserStore.scripts.push(script);
|
||||
script.exists(true);
|
||||
script.hasChanges(false);
|
||||
} else {
|
||||
self.saveError(true);
|
||||
self.saveErrorText((data && data.ErrorCode)
|
||||
? (data.ErrorMessageAdditional || getNotification(data.ErrorCode))
|
||||
: getNotification(Notification.CantSaveFilters)
|
||||
);
|
||||
}
|
||||
},
|
||||
script
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue