mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Improve Settings handling
This commit is contained in:
parent
e7b1ce7509
commit
34b25eedea
39 changed files with 160 additions and 150 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import ko from 'ko';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
|
||||
class AccountUserStore {
|
||||
constructor() {
|
||||
|
|
@ -27,8 +28,8 @@ class AccountUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
this.email(rl.settings.get('Email'));
|
||||
this.parentEmail(rl.settings.get('ParentEmail'));
|
||||
this.email(SettingsGet('Email'));
|
||||
this.parentEmail(SettingsGet('ParentEmail'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
import { KeyState } from 'Common/Enums';
|
||||
import { Focused } from 'Common/EnumsUser';
|
||||
import { keyScope, leftPanelDisabled, Settings } from 'Common/Globals';
|
||||
import { keyScope, leftPanelDisabled, Settings, SettingsGet } from 'Common/Globals';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
class AppUserStore {
|
||||
|
|
@ -48,18 +48,18 @@ class AppUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
this.projectHash(Settings.get('ProjectHash'));
|
||||
this.projectHash(SettingsGet('ProjectHash'));
|
||||
|
||||
this.contactsAutosave(!!Settings.get('ContactsAutosave'));
|
||||
this.useLocalProxyForExternalImages(!!Settings.get('UseLocalProxyForExternalImages'));
|
||||
this.contactsAutosave(!!SettingsGet('ContactsAutosave'));
|
||||
this.useLocalProxyForExternalImages(!!SettingsGet('UseLocalProxyForExternalImages'));
|
||||
|
||||
this.contactsIsAllowed(!!Settings.get('ContactsIsAllowed'));
|
||||
this.contactsIsAllowed(!!SettingsGet('ContactsIsAllowed'));
|
||||
|
||||
const attachmentsActions = Settings.app('attachmentsActions');
|
||||
this.attachmentsActions(Array.isNotEmpty(attachmentsActions) ? attachmentsActions : []);
|
||||
|
||||
this.devEmail = Settings.get('DevEmail');
|
||||
this.devPassword = Settings.get('DevPassword');
|
||||
this.devEmail = SettingsGet('DevEmail');
|
||||
this.devPassword = SettingsGet('DevPassword');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import ko from 'ko';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
|
||||
class ContactUserStore {
|
||||
constructor() {
|
||||
|
|
@ -19,13 +20,12 @@ class ContactUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
const settingsGet = rl.settings.get;
|
||||
this.allowContactsSync(!!settingsGet('ContactsSyncIsAllowed'));
|
||||
this.enableContactsSync(!!settingsGet('EnableContactsSync'));
|
||||
this.allowContactsSync(!!SettingsGet('ContactsSyncIsAllowed'));
|
||||
this.enableContactsSync(!!SettingsGet('EnableContactsSync'));
|
||||
|
||||
this.contactsSyncUrl(settingsGet('ContactsSyncUrl'));
|
||||
this.contactsSyncUser(settingsGet('ContactsSyncUser'));
|
||||
this.contactsSyncPass(settingsGet('ContactsSyncPassword'));
|
||||
this.contactsSyncUrl(SettingsGet('ContactsSyncUrl'));
|
||||
this.contactsSyncUser(SettingsGet('ContactsSyncUser'));
|
||||
this.contactsSyncPass(SettingsGet('ContactsSyncPassword'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { FolderType } from 'Common/EnumsUser';
|
|||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||
import { folderListOptionsBuilder } from 'Common/UtilsUser';
|
||||
import { getFolderInboxName, getFolderFromCacheList } from 'Common/Cache';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
|
||||
class FolderUserStore {
|
||||
constructor() {
|
||||
|
|
@ -40,7 +41,7 @@ class FolderUserStore {
|
|||
|
||||
this.currentFolder = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'selected'] });
|
||||
|
||||
this.sieveAllowFileintoInbox = !!rl.settings.get('SieveAllowFileintoInbox');
|
||||
this.sieveAllowFileintoInbox = !!SettingsGet('SieveAllowFileintoInbox');
|
||||
|
||||
this.draftFolderNotEnabled = ko.computed(
|
||||
() => !this.draftFolder() || UNUSED_OPTION_VALUE === this.draftFolder()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import Audio from 'Common/Audio';
|
||||
import { SettingsGet } from 'Common/Globals';
|
||||
import * as Links from 'Common/Links';
|
||||
|
||||
/**
|
||||
|
|
@ -102,8 +103,8 @@ class NotificationUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
this.enableSoundNotification(!!rl.settings.get('SoundNotification'));
|
||||
this.enableDesktopNotification(!!rl.settings.get('DesktopNotifications'));
|
||||
this.enableSoundNotification(!!SettingsGet('SoundNotification'));
|
||||
this.enableDesktopNotification(!!SettingsGet('DesktopNotifications'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
|||
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
||||
import { Layout, EditorDefaultType } from 'Common/EnumsUser';
|
||||
import { pInt } from 'Common/Utils';
|
||||
import { $htmlCL, Settings } from 'Common/Globals';
|
||||
import { $htmlCL, SettingsGet } from 'Common/Globals';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
class SettingsUserStore {
|
||||
|
|
@ -41,7 +41,7 @@ class SettingsUserStore {
|
|||
let iAutoLogoutTimer;
|
||||
this.delayLogout = (() => {
|
||||
clearTimeout(iAutoLogoutTimer);
|
||||
if (0 < this.autoLogout() && !Settings.get('AccountSignMe')) {
|
||||
if (0 < this.autoLogout() && !SettingsGet('AccountSignMe')) {
|
||||
iAutoLogoutTimer = setTimeout(
|
||||
rl.app.logout,
|
||||
this.autoLogout() * 60000
|
||||
|
|
@ -60,19 +60,18 @@ class SettingsUserStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
const settingsGet = Settings.get;
|
||||
this.layout(pInt(settingsGet('Layout')));
|
||||
this.editorDefaultType(settingsGet('EditorDefaultType'));
|
||||
this.layout(pInt(SettingsGet('Layout')));
|
||||
this.editorDefaultType(SettingsGet('EditorDefaultType'));
|
||||
|
||||
this.autoLogout(pInt(settingsGet('AutoLogout')));
|
||||
this.messagesPerPage(settingsGet('MPP'));
|
||||
this.autoLogout(pInt(SettingsGet('AutoLogout')));
|
||||
this.messagesPerPage(SettingsGet('MPP'));
|
||||
|
||||
this.showImages(!!settingsGet('ShowImages'));
|
||||
this.removeColors(!!settingsGet('RemoveColors'));
|
||||
this.useCheckboxesInList(!!(ThemeStore.isMobile() || settingsGet('UseCheckboxesInList')));
|
||||
this.allowDraftAutosave(!!settingsGet('AllowDraftAutosave'));
|
||||
this.useThreads(!!settingsGet('UseThreads'));
|
||||
this.replySameFolder(!!settingsGet('ReplySameFolder'));
|
||||
this.showImages(!!SettingsGet('ShowImages'));
|
||||
this.removeColors(!!SettingsGet('RemoveColors'));
|
||||
this.useCheckboxesInList(!!(ThemeStore.isMobile() || SettingsGet('UseCheckboxesInList')));
|
||||
this.allowDraftAutosave(!!SettingsGet('AllowDraftAutosave'));
|
||||
this.useThreads(!!SettingsGet('UseThreads'));
|
||||
this.replySameFolder(!!SettingsGet('ReplySameFolder'));
|
||||
|
||||
this.delayLogout();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue