mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +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,4 +1,3 @@
|
|||
import { Notification } from 'Common/Enums';
|
||||
import { i18n, getNotification } from 'Common/Translator';
|
||||
import { setFolderHash } from 'Common/Cache';
|
||||
|
||||
|
|
@ -54,17 +53,13 @@ class FolderClearPopupView extends AbstractViewPopup {
|
|||
|
||||
setFolderHash(folderToClear.fullNameRaw, '');
|
||||
|
||||
Remote.folderClear((iError, data) => {
|
||||
Remote.folderClear(iError => {
|
||||
this.clearingProcess(false);
|
||||
if (!iError && data && data.Result) {
|
||||
if (iError) {
|
||||
this.clearingError(getNotification(iError));
|
||||
} else {
|
||||
rl.app.reloadMessageList(true);
|
||||
this.cancelCommand();
|
||||
} else {
|
||||
if (data && data.ErrorCode) {
|
||||
this.clearingError(getNotification(data.ErrorCode));
|
||||
} else {
|
||||
this.clearingError(getNotification(Notification.MailServerError));
|
||||
}
|
||||
}
|
||||
}, folderToClear.fullNameRaw);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue