mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09: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 { Settings } from 'Common/Globals';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
|
||||
|
|
@ -59,17 +58,12 @@ class LoginAdminView extends AbstractViewCenter {
|
|||
this.submitRequest(true);
|
||||
|
||||
Remote.adminLogin(
|
||||
(iError, oData) => {
|
||||
if (!iError && oData && 'AdminLogin' === oData.Action) {
|
||||
if (oData.Result) {
|
||||
rl.route.reload();
|
||||
} else if (oData.ErrorCode) {
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(oData.ErrorCode));
|
||||
}
|
||||
(iError) => {
|
||||
this.submitRequest(false);
|
||||
if (iError) {
|
||||
this.submitError(getNotification(iError));
|
||||
} else {
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
rl.route.reload();
|
||||
}
|
||||
},
|
||||
this.login(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue