mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Drop AbstractAppStore and
put the properties/observables where they belong
This commit is contained in:
parent
917dfa732e
commit
0eba94f671
12 changed files with 145 additions and 191 deletions
|
|
@ -1,17 +0,0 @@
|
|||
import ko from 'ko';
|
||||
|
||||
class AbstractAppStore {
|
||||
constructor() {
|
||||
this.allowLanguagesOnSettings = ko.observable(true);
|
||||
this.allowLanguagesOnLogin = ko.observable(true);
|
||||
this.newMoveToFolder = ko.observable(true);
|
||||
}
|
||||
|
||||
populate() {
|
||||
this.allowLanguagesOnLogin(!!rl.settings.get('AllowLanguagesOnLogin'));
|
||||
this.allowLanguagesOnSettings(!!rl.settings.get('AllowLanguagesOnSettings'));
|
||||
this.newMoveToFolder(!!rl.settings.get('NewMoveToFolder'));
|
||||
}
|
||||
}
|
||||
|
||||
export { AbstractAppStore, AbstractAppStore as default };
|
||||
|
|
@ -1,28 +1,14 @@
|
|||
import ko from 'ko';
|
||||
import { AbstractAppStore } from 'Stores/AbstractApp';
|
||||
|
||||
class AppAdminStore extends AbstractAppStore {
|
||||
class AppAdminStore {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.determineUserLanguage = ko.observable(false);
|
||||
this.determineUserDomain = ko.observable(false);
|
||||
|
||||
this.weakPassword = ko.observable(false);
|
||||
this.useLocalProxyForExternalImages = ko.observable(false);
|
||||
|
||||
this.dataFolderAccess = ko.observable(false);
|
||||
}
|
||||
|
||||
populate() {
|
||||
super.populate();
|
||||
|
||||
const settingsGet = rl.settings.get;
|
||||
this.determineUserLanguage(!!settingsGet('DetermineUserLanguage'));
|
||||
this.determineUserDomain(!!settingsGet('DetermineUserDomain'));
|
||||
|
||||
this.weakPassword(!!settingsGet('WeakPassword'));
|
||||
this.useLocalProxyForExternalImages(!!settingsGet('UseLocalProxyForExternalImages'));
|
||||
this.weakPassword(!!rl.settings.get('WeakPassword'));
|
||||
/*
|
||||
if (settingsGet('Auth')) {
|
||||
fetch('./data/VERSION?' + Math.random()).then(() => this.dataFolderAccess(true));
|
||||
|
|
|
|||
|
|
@ -3,14 +3,10 @@ import { Focused, KeyState } from 'Common/Enums';
|
|||
|
||||
import { keyScope, leftPanelDisabled } from 'Common/Globals';
|
||||
|
||||
import { AbstractAppStore } from 'Stores/AbstractApp';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
||||
class AppUserStore extends AbstractAppStore {
|
||||
class AppUserStore {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.currentAudio = ko.observable('');
|
||||
|
||||
this.focusedState = ko.observable(Focused.None);
|
||||
|
|
@ -59,8 +55,6 @@ class AppUserStore extends AbstractAppStore {
|
|||
}
|
||||
|
||||
populate() {
|
||||
super.populate();
|
||||
|
||||
this.projectHash(Settings.get('ProjectHash'));
|
||||
|
||||
this.contactsAutosave(!!Settings.get('ContactsAutosave'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue