mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Changed: StorageResultType to error result code
This commit is contained in:
parent
be3ef15f8e
commit
4a8d516123
33 changed files with 257 additions and 302 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { Capa, StorageResultType } from 'Common/Enums';
|
||||
import { Capa } from 'Common/Enums';
|
||||
import { Settings } from 'Common/Globals';
|
||||
|
||||
import { AccountUserStore } from 'Stores/User/Account';
|
||||
|
|
@ -53,8 +53,8 @@ export class AccountsUserSettings {
|
|||
if (accountToRemove) {
|
||||
this.accounts.remove((account) => accountToRemove === account);
|
||||
|
||||
Remote.accountDelete((result, data) => {
|
||||
if (StorageResultType.Success === result && data && data.Result && data.Reload) {
|
||||
Remote.accountDelete((iError, data) => {
|
||||
if (!iError && data && data.Result && data.Reload) {
|
||||
rl.route.root();
|
||||
setTimeout(() => location.reload(), 1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
||||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { Notification } from 'Common/Enums';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
|
||||
import { SieveUserStore } from 'Stores/User/Sieve';
|
||||
|
|
@ -36,11 +36,11 @@ export class FiltersUserSettings {
|
|||
this.loading(true);
|
||||
this.serverError(false);
|
||||
|
||||
Remote.filtersGet((result, data) => {
|
||||
Remote.filtersGet((iError, data) => {
|
||||
this.loading(false);
|
||||
this.scripts([]);
|
||||
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
if (!iError && data && data.Result) {
|
||||
SieveUserStore.capa(data.Result.Capa);
|
||||
/*
|
||||
this.scripts(
|
||||
|
|
@ -73,7 +73,7 @@ export class FiltersUserSettings {
|
|||
this.serverError(false);
|
||||
Remote.filtersScriptDelete(
|
||||
(result, data) => {
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
if (Remote.SUCCESS === result && data && data.Result) {
|
||||
this.scripts.remove(script);
|
||||
delegateRunOnDestroy(script);
|
||||
} else {
|
||||
|
|
@ -92,7 +92,7 @@ export class FiltersUserSettings {
|
|||
this.serverError(false);
|
||||
Remote.filtersScriptActivate(
|
||||
(result, data) => {
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
if (Remote.SUCCESS === result && data && data.Result) {
|
||||
this.scripts.forEach(script => script.active(script.name() === name));
|
||||
} else {
|
||||
this.setError((data && data.ErrorCode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue