mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Remove Common/Enums Magics.*
This commit is contained in:
parent
382aef7ebb
commit
6541a1de7c
38 changed files with 135 additions and 219 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import ko from 'ko';
|
||||
import { Magics } from 'Common/Enums';
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
class AccountUserStore {
|
||||
|
|
@ -10,7 +9,7 @@ class AccountUserStore {
|
|||
this.signature = ko.observable('');
|
||||
|
||||
this.accounts = ko.observableArray([]);
|
||||
this.accounts.loading = ko.observable(false).extend({ throttle: Magics.Time100ms });
|
||||
this.accounts.loading = ko.observable(false).extend({ throttle: 100 });
|
||||
|
||||
this.computers();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
import ko from 'ko';
|
||||
import { Magics } from 'Common/Enums';
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
class ContactUserStore {
|
||||
constructor() {
|
||||
this.contacts = ko.observableArray([]);
|
||||
this.contacts.loading = ko.observable(false).extend({ throttle: Magics.Time200ms });
|
||||
this.contacts.importing = ko.observable(false).extend({ throttle: Magics.Time200ms });
|
||||
this.contacts.syncing = ko.observable(false).extend({ throttle: Magics.Time200ms });
|
||||
this.contacts.exportingVcf = ko.observable(false).extend({ throttle: Magics.Time200ms });
|
||||
this.contacts.exportingCsv = ko.observable(false).extend({ throttle: Magics.Time200ms });
|
||||
this.contacts.loading = ko.observable(false).extend({ throttle: 200 });
|
||||
this.contacts.importing = ko.observable(false).extend({ throttle: 200 });
|
||||
this.contacts.syncing = ko.observable(false).extend({ throttle: 200 });
|
||||
this.contacts.exportingVcf = ko.observable(false).extend({ throttle: 200 });
|
||||
this.contacts.exportingCsv = ko.observable(false).extend({ throttle: 200 });
|
||||
|
||||
this.allowContactsSync = ko.observable(false);
|
||||
this.enableContactsSync = ko.observable(false);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import ko from 'ko';
|
||||
import { Magics } from 'Common/Enums';
|
||||
|
||||
class FilterUserStore {
|
||||
constructor() {
|
||||
|
|
@ -8,8 +7,8 @@ class FilterUserStore {
|
|||
|
||||
this.filters = ko.observableArray([]);
|
||||
|
||||
this.filters.loading = ko.observable(false).extend({ throttle: Magics.Time200ms });
|
||||
this.filters.saving = ko.observable(false).extend({ throttle: Magics.Time200ms });
|
||||
this.filters.loading = ko.observable(false).extend({ throttle: 200 });
|
||||
this.filters.saving = ko.observable(false).extend({ throttle: 200 });
|
||||
|
||||
this.raw = ko.observable('');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { Magics, Layout, Focused, MessageSetAction, StorageResultType, Notification } from 'Common/Enums';
|
||||
import { Layout, Focused, MessageSetAction, StorageResultType, Notification } from 'Common/Enums';
|
||||
|
||||
import {
|
||||
isNormal,
|
||||
|
|
@ -102,7 +102,7 @@ class MessageUserStore {
|
|||
|
||||
this.messageCurrentLoading = ko.observable(false);
|
||||
|
||||
this.messageLoadingThrottle = ko.observable(false).extend({ throttle: Magics.Time50ms });
|
||||
this.messageLoadingThrottle = ko.observable(false).extend({ throttle: 50 });
|
||||
|
||||
this.messageFullScreenMode = ko.observable(false);
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ class MessageUserStore {
|
|||
t = setTimeout(()=>{
|
||||
o.purgeMessageBodyCache();
|
||||
t = 0;
|
||||
}, Magics.Time30s);
|
||||
}, 30000);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -214,7 +214,7 @@ class MessageUserStore {
|
|||
if (item && item.newForAnimation()) {
|
||||
item.newForAnimation(false);
|
||||
}
|
||||
}), Magics.Time500ms);
|
||||
}), 500);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -265,7 +265,7 @@ class MessageUserStore {
|
|||
});
|
||||
|
||||
if (0 < count) {
|
||||
setTimeout(() => messagesDom.find('.rl-cache-purge').remove(), Magics.Time350ms);
|
||||
setTimeout(() => messagesDom.find('.rl-cache-purge').remove(), 350);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -388,7 +388,7 @@ class MessageUserStore {
|
|||
messages.forEach(item => {
|
||||
this.messageList.remove(item);
|
||||
});
|
||||
}, Magics.Time350ms);
|
||||
}, 350);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { DesktopNotification, Magics } from 'Common/Enums';
|
||||
import { DesktopNotification } from 'Common/Enums';
|
||||
import * as Events from 'Common/Events';
|
||||
import Audio from 'Common/Audio';
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ class NotificationUserStore {
|
|||
}
|
||||
};
|
||||
})(notification),
|
||||
Magics.Time7s
|
||||
7000
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { Magics } from 'Common/Enums';
|
||||
|
||||
class QuotaUserStore {
|
||||
constructor() {
|
||||
this.quota = ko.observable(0);
|
||||
|
|
@ -20,8 +18,8 @@ class QuotaUserStore {
|
|||
* @param {number} usage
|
||||
*/
|
||||
populateData(quota, usage) {
|
||||
this.quota(quota * Magics.BitLength1024);
|
||||
this.usage(usage * Magics.BitLength1024);
|
||||
this.quota(quota * 1024);
|
||||
this.usage(usage * 1024);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { MESSAGES_PER_PAGE, MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
||||
import { Layout, EditorDefaultType, Magics } from 'Common/Enums';
|
||||
import { Layout, EditorDefaultType } from 'Common/Enums';
|
||||
import { $htmlCL } from 'Common/Globals';
|
||||
import { pInt } from 'Common/Utils';
|
||||
import * as Events from 'Common/Events';
|
||||
|
|
@ -33,7 +33,7 @@ class SettingsUserStore {
|
|||
this.useThreads = ko.observable(false);
|
||||
this.replySameFolder = ko.observable(false);
|
||||
|
||||
this.autoLogout = ko.observable(Magics.Time30mInMin);
|
||||
this.autoLogout = ko.observable(30);
|
||||
|
||||
this.computers();
|
||||
this.subscribers();
|
||||
|
|
@ -70,7 +70,7 @@ class SettingsUserStore {
|
|||
if (0 < this.autoLogout() && !Settings.settingsGet('AccountSignMe')) {
|
||||
this.iAutoLogoutTimer = setTimeout(() => {
|
||||
Events.pub('rl.auto-logout');
|
||||
}, this.autoLogout() * Magics.Time1m);
|
||||
}, this.autoLogout() * 60000);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue