mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49: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 { SaveSettingsStep, StorageResultType } from 'Common/Enums';
|
||||
import { SaveSettingsStep } from 'Common/Enums';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
import { settingsSaveHelperSimpleFunction, defaultOptionsAfterRender } from 'Common/Utils';
|
||||
|
||||
|
|
@ -93,12 +93,12 @@ export class ContactsAdminSettings {
|
|||
});
|
||||
}
|
||||
|
||||
onTestContactsResponse(result, data) {
|
||||
onTestContactsResponse(iError, data) {
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
|
||||
if (StorageResultType.Success === result && data && data.Result && data.Result.Result) {
|
||||
if (!iError && data && data.Result && data.Result.Result) {
|
||||
this.testContactsSuccess(true);
|
||||
} else {
|
||||
this.testContactsError(true);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { StorageResultType } from 'Common/Enums';
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import { DomainAdminStore } from 'Stores/Admin/Domain';
|
||||
|
|
@ -46,8 +45,8 @@ export class DomainsAdminSettings {
|
|||
DomainAdminStore.fetch();
|
||||
}
|
||||
|
||||
onDomainLoadRequest(sResult, oData) {
|
||||
if (StorageResultType.Success === sResult && oData && oData.Result) {
|
||||
onDomainLoadRequest(iError, oData) {
|
||||
if (!iError && oData && oData.Result) {
|
||||
showScreenPopup(DomainPopupView, [oData.Result]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { Notification } from 'Common/Enums';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
|
||||
import { PackageAdminStore } from 'Stores/Admin/Package';
|
||||
|
|
@ -34,8 +34,8 @@ export class PackagesAdminSettings {
|
|||
}
|
||||
|
||||
requestHelper(packageToRequest, install) {
|
||||
return (result, data) => {
|
||||
if (StorageResultType.Success !== result || !data || !data.Result) {
|
||||
return (iError, data) => {
|
||||
if (iError || !data || !data.Result) {
|
||||
if (data && data.ErrorCode) {
|
||||
this.packagesError(getNotification(data.ErrorCode));
|
||||
} else {
|
||||
|
|
@ -52,7 +52,7 @@ export class PackagesAdminSettings {
|
|||
}
|
||||
});
|
||||
|
||||
if (StorageResultType.Success === result && data && data.Result && data.Result.Reload) {
|
||||
if (!iError && data && data.Result && data.Result.Reload) {
|
||||
location.reload();
|
||||
} else {
|
||||
PackageAdminStore.fetch();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { Notification } from 'Common/Enums';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
|
||||
|
|
@ -53,14 +53,14 @@ export class PluginsAdminSettings {
|
|||
PluginAdminStore.fetch();
|
||||
}
|
||||
|
||||
onPluginLoadRequest(result, data) {
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
onPluginLoadRequest(iError, data) {
|
||||
if (!iError && data && data.Result) {
|
||||
showScreenPopup(PluginPopupView, [data.Result]);
|
||||
}
|
||||
}
|
||||
|
||||
onPluginDisableRequest(result, data) {
|
||||
if (StorageResultType.Success === result && data) {
|
||||
onPluginDisableRequest(iError, data) {
|
||||
if (!iError && data) {
|
||||
if (!data.Result && data.ErrorCode) {
|
||||
if (Notification.UnsupportedPluginPackage === data.ErrorCode && data.ErrorMessage && data.ErrorMessage) {
|
||||
PluginAdminStore.error(data.ErrorMessage);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { StorageResultType } from 'Common/Enums';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
|
||||
import { AppAdminStore } from 'Stores/Admin/App';
|
||||
|
|
@ -112,8 +111,8 @@ export class SecurityAdminSettings {
|
|||
}, 50);
|
||||
}
|
||||
|
||||
onNewAdminPasswordResponse(result, data) {
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
onNewAdminPasswordResponse(iError, data) {
|
||||
if (!iError && data && data.Result) {
|
||||
this.adminPassword('');
|
||||
this.adminPasswordNew('');
|
||||
this.adminPasswordNew2('');
|
||||
|
|
|
|||
|
|
@ -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