mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +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('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue