mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +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,5 @@
|
|||
import ko from 'ko';
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
import { StorageResultType } from 'Common/Enums';
|
||||
|
||||
export const DomainAdminStore = ko.observableArray();
|
||||
|
||||
|
|
@ -8,9 +7,9 @@ DomainAdminStore.loading = ko.observable(false);
|
|||
|
||||
DomainAdminStore.fetch = () => {
|
||||
DomainAdminStore.loading(true);
|
||||
Remote.domainList((result, data) => {
|
||||
Remote.domainList((iError, data) => {
|
||||
DomainAdminStore.loading(false);
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
if (!iError && data && data.Result) {
|
||||
DomainAdminStore(
|
||||
Object.entries(data.Result).map(([name, [enabled, alias]]) => ({
|
||||
name: name,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import ko from 'ko';
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
import { StorageResultType } from 'Common/Enums';
|
||||
|
||||
export const PackageAdminStore = ko.observableArray();
|
||||
|
||||
|
|
@ -10,9 +9,9 @@ PackageAdminStore.loading = ko.observable(false);
|
|||
|
||||
PackageAdminStore.fetch = () => {
|
||||
PackageAdminStore.loading(true);
|
||||
Remote.packagesList((result, data) => {
|
||||
Remote.packagesList((iError, data) => {
|
||||
PackageAdminStore.loading(false);
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
if (!iError && data && data.Result) {
|
||||
PackageAdminStore.real(!!data.Result.Real);
|
||||
|
||||
let list = [];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import ko from 'ko';
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
import { StorageResultType } from 'Common/Enums';
|
||||
|
||||
export const PluginAdminStore = ko.observableArray();
|
||||
|
||||
|
|
@ -10,9 +9,9 @@ PluginAdminStore.error = ko.observable('');
|
|||
|
||||
PluginAdminStore.fetch = () => {
|
||||
PluginAdminStore.loading(true);
|
||||
Remote.pluginList((result, data) => {
|
||||
Remote.pluginList((iError, data) => {
|
||||
PluginAdminStore.loading(false);
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
if (!iError && data && data.Result) {
|
||||
PluginAdminStore(
|
||||
data.Result.map(item => ({
|
||||
name: item.Name,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { Notification } from 'Common/Enums';
|
||||
import { Focused, MessageSetAction } from 'Common/EnumsUser';
|
||||
import { doc, elementById } from 'Common/Globals';
|
||||
import { pInt, pString } from 'Common/Utils';
|
||||
|
|
@ -638,13 +638,10 @@ export const MessageUserStore = new class {
|
|||
* @param {FetchJsonDefaultResponse} oData
|
||||
* @param {boolean} bCached
|
||||
*/
|
||||
onMessageResponse(sResult, oData, bCached) {
|
||||
if (StorageResultType.Success === sResult && oData && oData.Result) {
|
||||
onMessageResponse(iError, oData, bCached) {
|
||||
if (!iError && oData && oData.Result) {
|
||||
this.setMessage(oData, bCached);
|
||||
} else if (StorageResultType.Unload === sResult) {
|
||||
this.message(null);
|
||||
this.messageError('');
|
||||
} else if (StorageResultType.Abort !== sResult) {
|
||||
} else if (Remote.ABORT !== iError) {
|
||||
this.message(null);
|
||||
this.messageError(
|
||||
oData && oData.ErrorCode ? getNotification(oData.ErrorCode) : getNotification(Notification.UnknownError)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue