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 { getNotification } from 'Common/Translator';
|
||||
import { HtmlEditor } from 'Common/Html';
|
||||
|
||||
|
|
@ -53,17 +52,13 @@ class TemplatePopupView extends AbstractViewPopup {
|
|||
this.submitRequest(true);
|
||||
|
||||
Remote.templateSetup(
|
||||
(iError, data) => {
|
||||
iError => {
|
||||
this.submitRequest(false);
|
||||
if (!iError && data) {
|
||||
if (data.Result) {
|
||||
rl.app.templates();
|
||||
this.cancelCommand();
|
||||
} else if (data.ErrorCode) {
|
||||
this.submitError(getNotification(data.ErrorCode));
|
||||
}
|
||||
if (iError) {
|
||||
this.submitError(getNotification(iError));
|
||||
} else {
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
rl.app.templates();
|
||||
this.cancelCommand();
|
||||
}
|
||||
},
|
||||
this.id(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue