mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Improved boot.js with existing global window.rl
Put dev/Storage/Settings.js in boots.js global rl.settings
This commit is contained in:
parent
f90dbcc84b
commit
aeb5275648
57 changed files with 284 additions and 380 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import ko from 'ko';
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
class AccountUserStore {
|
||||
constructor() {
|
||||
|
|
@ -33,8 +32,8 @@ class AccountUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
this.email(Settings.settingsGet('Email'));
|
||||
this.parentEmail(Settings.settingsGet('ParentEmail'));
|
||||
this.email(rl.settings.get('Email'));
|
||||
this.parentEmail(rl.settings.get('ParentEmail'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ import { Focused, KeyState } from 'Common/Enums';
|
|||
import { keyScope, leftPanelDisabled } from 'Common/Globals';
|
||||
import { isNonEmptyArray } from 'Common/Utils';
|
||||
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
import { AbstractAppStore } from 'Stores/AbstractApp';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
||||
class AppUserStore extends AbstractAppStore {
|
||||
constructor() {
|
||||
super();
|
||||
|
|
@ -16,7 +16,7 @@ class AppUserStore extends AbstractAppStore {
|
|||
|
||||
this.focusedState = ko.observable(Focused.None);
|
||||
|
||||
const isMobile = Settings.appSettingsGet('mobile');
|
||||
const isMobile = Settings.app('mobile');
|
||||
|
||||
this.focusedState.subscribe((value) => {
|
||||
switch (value) {
|
||||
|
|
@ -62,18 +62,18 @@ class AppUserStore extends AbstractAppStore {
|
|||
populate() {
|
||||
super.populate();
|
||||
|
||||
this.projectHash(Settings.settingsGet('ProjectHash'));
|
||||
this.projectHash(Settings.get('ProjectHash'));
|
||||
|
||||
this.contactsAutosave(!!Settings.settingsGet('ContactsAutosave'));
|
||||
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
|
||||
this.contactsAutosave(!!Settings.get('ContactsAutosave'));
|
||||
this.useLocalProxyForExternalImages(!!Settings.get('UseLocalProxyForExternalImages'));
|
||||
|
||||
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
|
||||
this.contactsIsAllowed(!!Settings.get('ContactsIsAllowed'));
|
||||
|
||||
const attachmentsActions = Settings.appSettingsGet('attachmentsActions');
|
||||
const attachmentsActions = Settings.app('attachmentsActions');
|
||||
this.attachmentsActions(isNonEmptyArray(attachmentsActions) ? attachmentsActions : []);
|
||||
|
||||
this.devEmail = Settings.settingsGet('DevEmail');
|
||||
this.devPassword = Settings.settingsGet('DevPassword');
|
||||
this.devEmail = Settings.get('DevEmail');
|
||||
this.devPassword = Settings.get('DevPassword');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import ko from 'ko';
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
class ContactUserStore {
|
||||
constructor() {
|
||||
|
|
@ -18,12 +17,13 @@ class ContactUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
this.allowContactsSync(!!Settings.settingsGet('ContactsSyncIsAllowed'));
|
||||
this.enableContactsSync(!!Settings.settingsGet('EnableContactsSync'));
|
||||
const settingsGet = rl.settings.get;
|
||||
this.allowContactsSync(!!settingsGet('ContactsSyncIsAllowed'));
|
||||
this.enableContactsSync(!!settingsGet('EnableContactsSync'));
|
||||
|
||||
this.contactsSyncUrl(Settings.settingsGet('ContactsSyncUrl'));
|
||||
this.contactsSyncUser(Settings.settingsGet('ContactsSyncUser'));
|
||||
this.contactsSyncPass(Settings.settingsGet('ContactsSyncPassword'));
|
||||
this.contactsSyncUrl(settingsGet('ContactsSyncUrl'));
|
||||
this.contactsSyncUser(settingsGet('ContactsSyncUser'));
|
||||
this.contactsSyncPass(settingsGet('ContactsSyncPassword'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { settingsGet } from 'Storage/Settings';
|
||||
|
||||
import { FolderType } from 'Common/Enums';
|
||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||
import { folderListOptionsBuilder } from 'Common/Utils';
|
||||
|
|
@ -32,7 +30,7 @@ class FolderUserStore {
|
|||
|
||||
this.currentFolder = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'selected'] });
|
||||
|
||||
this.sieveAllowFileintoInbox = !!settingsGet('SieveAllowFileintoInbox');
|
||||
this.sieveAllowFileintoInbox = !!rl.settings.get('SieveAllowFileintoInbox');
|
||||
|
||||
this.computers();
|
||||
this.subscribers();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import ko from 'ko';
|
|||
import { DesktopNotification } from 'Common/Enums';
|
||||
import Audio from 'Common/Audio';
|
||||
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
class NotificationUserStore {
|
||||
constructor() {
|
||||
|
|
@ -159,8 +158,8 @@ class NotificationUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
this.enableSoundNotification(!!Settings.settingsGet('SoundNotification'));
|
||||
this.enableDesktopNotification(!!Settings.settingsGet('DesktopNotifications'));
|
||||
this.enableSoundNotification(!!rl.settings.get('SoundNotification'));
|
||||
this.enableDesktopNotification(!!rl.settings.get('DesktopNotifications'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import { MESSAGES_PER_PAGE, MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
|||
import { Layout, EditorDefaultType } from 'Common/Enums';
|
||||
import { pInt } from 'Common/Utils';
|
||||
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
class SettingsUserStore {
|
||||
constructor() {
|
||||
this.iAutoLogoutTimer = 0;
|
||||
|
|
@ -52,21 +50,22 @@ class SettingsUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
this.layout(pInt(Settings.settingsGet('Layout')));
|
||||
this.editorDefaultType(Settings.settingsGet('EditorDefaultType'));
|
||||
const settingsGet = rl.settings.get;
|
||||
this.layout(pInt(settingsGet('Layout')));
|
||||
this.editorDefaultType(settingsGet('EditorDefaultType'));
|
||||
|
||||
this.autoLogout(pInt(Settings.settingsGet('AutoLogout')));
|
||||
this.messagesPerPage(Settings.settingsGet('MPP'));
|
||||
this.autoLogout(pInt(settingsGet('AutoLogout')));
|
||||
this.messagesPerPage(settingsGet('MPP'));
|
||||
|
||||
this.showImages(!!Settings.settingsGet('ShowImages'));
|
||||
this.useCheckboxesInList(!!Settings.settingsGet('UseCheckboxesInList'));
|
||||
this.allowDraftAutosave(!!Settings.settingsGet('AllowDraftAutosave'));
|
||||
this.useThreads(!!Settings.settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!Settings.settingsGet('ReplySameFolder'));
|
||||
this.showImages(!!settingsGet('ShowImages'));
|
||||
this.useCheckboxesInList(!!settingsGet('UseCheckboxesInList'));
|
||||
this.allowDraftAutosave(!!settingsGet('AllowDraftAutosave'));
|
||||
this.useThreads(!!settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!settingsGet('ReplySameFolder'));
|
||||
|
||||
const refresh = () => {
|
||||
clearTimeout(this.iAutoLogoutTimer);
|
||||
if (0 < this.autoLogout() && !Settings.settingsGet('AccountSignMe')) {
|
||||
if (0 < this.autoLogout() && !settingsGet('AccountSignMe')) {
|
||||
this.iAutoLogoutTimer = setTimeout(() =>
|
||||
dispatchEvent(new CustomEvent('rl.auto-logout'))
|
||||
, this.autoLogout() * 60000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue