mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +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,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { Scope, Notification } from 'Common/Enums';
|
||||
import { Scope } from 'Common/Enums';
|
||||
import { getNotification, i18n } from 'Common/Translator';
|
||||
import { isNonEmptyArray } from 'Common/Utils';
|
||||
|
||||
|
|
@ -53,16 +53,11 @@ class PluginPopupView extends AbstractViewPopup {
|
|||
Remote.pluginSettingsUpdate(this.onPluginSettingsUpdateResponse, list);
|
||||
}
|
||||
|
||||
onPluginSettingsUpdateResponse(iError, data) {
|
||||
if (!iError && data && data.Result) {
|
||||
this.cancelCommand();
|
||||
onPluginSettingsUpdateResponse(iError) {
|
||||
if (iError) {
|
||||
this.saveError(getNotification(iError));
|
||||
} else {
|
||||
this.saveError('');
|
||||
if (data && data.ErrorCode) {
|
||||
this.saveError(getNotification(data.ErrorCode));
|
||||
} else {
|
||||
this.saveError(getNotification(Notification.CantSavePluginSettings));
|
||||
}
|
||||
this.cancelCommand();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue