mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-09 06:28:28 +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
212
dev/App/User.js
212
dev/App/User.js
|
|
@ -895,16 +895,6 @@ class AppUser extends AbstractApp {
|
|||
Remote.logout(() => this.logoutReload(0 < (Settings.get('ParentEmail')||{length:0}).length));
|
||||
}
|
||||
|
||||
bootstartTwoFactorScreen() {
|
||||
showScreenPopup(require('View/Popup/TwoFactorConfiguration'), [true]);
|
||||
}
|
||||
|
||||
bootstartLoginScreen() {
|
||||
$htmlCL.remove('rl-user-auth');
|
||||
$htmlCL.add('rl-user-no-auth');
|
||||
startScreens([LoginUserScreen]);
|
||||
}
|
||||
|
||||
bootend() {
|
||||
if (window.progressJs) {
|
||||
progressJs.end();
|
||||
|
|
@ -931,127 +921,129 @@ class AppUser extends AbstractApp {
|
|||
|
||||
rl.setWindowTitle();
|
||||
if (Settings.get('Auth')) {
|
||||
$htmlCL.add('rl-user-auth');
|
||||
|
||||
if (
|
||||
Settings.capa(Capa.TwoFactor) &&
|
||||
Settings.capa(Capa.TwoFactorForce) &&
|
||||
Settings.get('RequireTwoFactor')
|
||||
) {
|
||||
this.bootend();
|
||||
this.bootstartTwoFactorScreen();
|
||||
showScreenPopup(require('View/Popup/TwoFactorConfiguration'), [true]);
|
||||
} else {
|
||||
rl.setWindowTitle(i18n('TITLES/LOADING'));
|
||||
|
||||
// require.ensure([], function() { // require code splitting
|
||||
|
||||
this.foldersReload((value) => {
|
||||
this.bootend();
|
||||
this.foldersReload(value => {
|
||||
try {
|
||||
this.bootend();
|
||||
|
||||
if (value) {
|
||||
if (startupUrl) {
|
||||
rl.route.setHash(root(startupUrl), true);
|
||||
}
|
||||
if (value) {
|
||||
if (startupUrl) {
|
||||
rl.route.setHash(root(startupUrl), true);
|
||||
}
|
||||
|
||||
if (window.crypto && crypto.getRandomValues && Settings.capa(Capa.OpenPGP)) {
|
||||
const openpgpCallback = () => {
|
||||
if (!window.openpgp) {
|
||||
return false;
|
||||
}
|
||||
PgpStore.openpgp = openpgp;
|
||||
|
||||
if (window.Worker) {
|
||||
try {
|
||||
PgpStore.openpgp.initWorker({ path: openPgpWorkerJs() });
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
if (window.crypto && crypto.getRandomValues && Settings.capa(Capa.OpenPGP)) {
|
||||
const openpgpCallback = () => {
|
||||
if (!window.openpgp) {
|
||||
return false;
|
||||
}
|
||||
PgpStore.openpgp = openpgp;
|
||||
|
||||
if (window.Worker) {
|
||||
try {
|
||||
PgpStore.openpgp.initWorker({ path: openPgpWorkerJs() });
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
PgpStore.openpgpKeyring = new openpgp.Keyring();
|
||||
PgpStore.capaOpenPGP(true);
|
||||
|
||||
this.reloadOpenPgpKeys();
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
if (!openpgpCallback()) {
|
||||
const script = doc.createElement('script');
|
||||
script.onload = openpgpCallback;
|
||||
script.onerror = () => console.error(script.src);
|
||||
script.src = openPgpJs();
|
||||
doc.head.append(script);
|
||||
}
|
||||
} else {
|
||||
PgpStore.capaOpenPGP(false);
|
||||
}
|
||||
|
||||
PgpStore.openpgpKeyring = new openpgp.Keyring();
|
||||
PgpStore.capaOpenPGP(true);
|
||||
startScreens([
|
||||
MailBoxUserScreen,
|
||||
Settings.capa(Capa.Settings) ? SettingsUserScreen : null
|
||||
// false ? AboutUserScreen : null
|
||||
]);
|
||||
|
||||
this.reloadOpenPgpKeys();
|
||||
setInterval(() => this.folderInformation(getFolderInboxName()), 120000);
|
||||
setInterval(() => {
|
||||
const sF = FolderStore.currentFolderFullNameRaw();
|
||||
if (getFolderInboxName() !== sF) {
|
||||
this.folderInformation(sF);
|
||||
}
|
||||
}, 180000);
|
||||
|
||||
return true;
|
||||
};
|
||||
setTimeout(() => setInterval(this.folderInformationMultiply, 120000), 300000);
|
||||
setInterval(this.quota, 900000);
|
||||
setInterval(this.foldersReload, 1200000);
|
||||
|
||||
if (!openpgpCallback()) {
|
||||
const script = doc.createElement('script');
|
||||
script.onload = openpgpCallback;
|
||||
script.onerror = () => console.error(script.src);
|
||||
script.src = openPgpJs();
|
||||
doc.head.append(script);
|
||||
contactsSyncInterval = 5 <= contactsSyncInterval ? contactsSyncInterval : 20;
|
||||
contactsSyncInterval = 320 >= contactsSyncInterval ? contactsSyncInterval : 320;
|
||||
|
||||
setTimeout(this.contactsSync, 10000);
|
||||
setTimeout(() => this.folderInformationMultiply(true), 2000);
|
||||
|
||||
setInterval(this.contactsSync, contactsSyncInterval * 60000 + 5000);
|
||||
|
||||
this.accountsAndIdentities(true);
|
||||
|
||||
setTimeout(() => {
|
||||
const sF = FolderStore.currentFolderFullNameRaw();
|
||||
if (getFolderInboxName() !== sF) {
|
||||
this.folderInformation(sF);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
setTimeout(this.quota, 5000);
|
||||
setTimeout(() => Remote.appDelayStart(()=>{}), 35000);
|
||||
|
||||
addEventListener('rl.auto-logout', () => this.logout());
|
||||
|
||||
if (
|
||||
!!Settings.get('AccountSignMe') &&
|
||||
navigator.registerProtocolHandler &&
|
||||
Settings.capa(Capa.Composer)
|
||||
) {
|
||||
setTimeout(() => {
|
||||
try {
|
||||
navigator.registerProtocolHandler(
|
||||
'mailto',
|
||||
location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s',
|
||||
'' + (Settings.get('Title') || 'SnappyMail')
|
||||
);
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (Settings.get('MailToEmail')) {
|
||||
mailToHelper(Settings.get('MailToEmail'), require('View/Popup/Compose'));
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (!Settings.app('mobile')) {
|
||||
setTimeout(() => this.initVerticalLayoutResizer(ClientSideKeyName.FolderListSize), 1);
|
||||
}
|
||||
} else {
|
||||
PgpStore.capaOpenPGP(false);
|
||||
this.logout();
|
||||
}
|
||||
|
||||
startScreens([
|
||||
MailBoxUserScreen,
|
||||
Settings.capa(Capa.Settings) ? SettingsUserScreen : null
|
||||
// false ? AboutUserScreen : null
|
||||
]);
|
||||
|
||||
setInterval(() => this.folderInformation(getFolderInboxName()), 120000);
|
||||
setInterval(() => {
|
||||
const sF = FolderStore.currentFolderFullNameRaw();
|
||||
if (getFolderInboxName() !== sF) {
|
||||
this.folderInformation(sF);
|
||||
}
|
||||
}, 180000);
|
||||
|
||||
setTimeout(() => setInterval(this.folderInformationMultiply, 120000), 300000);
|
||||
setInterval(this.quota, 900000);
|
||||
setInterval(this.foldersReload, 1200000);
|
||||
|
||||
contactsSyncInterval = 5 <= contactsSyncInterval ? contactsSyncInterval : 20;
|
||||
contactsSyncInterval = 320 >= contactsSyncInterval ? contactsSyncInterval : 320;
|
||||
|
||||
setTimeout(this.contactsSync, 10000);
|
||||
setTimeout(() => this.folderInformationMultiply(true), 2000);
|
||||
|
||||
setInterval(this.contactsSync, contactsSyncInterval * 60000 + 5000);
|
||||
|
||||
this.accountsAndIdentities(true);
|
||||
|
||||
setTimeout(() => {
|
||||
const sF = FolderStore.currentFolderFullNameRaw();
|
||||
if (getFolderInboxName() !== sF) {
|
||||
this.folderInformation(sF);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
setTimeout(this.quota, 5000);
|
||||
setTimeout(() => Remote.appDelayStart(()=>{}), 35000);
|
||||
|
||||
addEventListener('rl.auto-logout', () => this.logout());
|
||||
|
||||
if (
|
||||
!!Settings.get('AccountSignMe') &&
|
||||
navigator.registerProtocolHandler &&
|
||||
Settings.capa(Capa.Composer)
|
||||
) {
|
||||
setTimeout(() => {
|
||||
try {
|
||||
navigator.registerProtocolHandler(
|
||||
'mailto',
|
||||
location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s',
|
||||
'' + (Settings.get('Title') || 'SnappyMail')
|
||||
);
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (Settings.get('MailToEmail')) {
|
||||
mailToHelper(Settings.get('MailToEmail'), require('View/Popup/Compose'));
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (!Settings.app('mobile')) {
|
||||
setTimeout(() => this.initVerticalLayoutResizer(ClientSideKeyName.FolderListSize), 1);
|
||||
}
|
||||
} else {
|
||||
this.logout();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -1059,7 +1051,7 @@ class AppUser extends AbstractApp {
|
|||
}
|
||||
} else {
|
||||
this.bootend();
|
||||
this.bootstartLoginScreen();
|
||||
startScreens([LoginUserScreen]);
|
||||
}
|
||||
|
||||
setInterval(() => dispatchEvent(new CustomEvent('reload-time')), 60000);
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ class GeneralAdminSettings {
|
|||
this.capaAttachmentThumbnails = CapaAdminStore.attachmentThumbnails;
|
||||
this.capaTemplates = CapaAdminStore.templates;
|
||||
|
||||
this.allowLanguagesOnSettings = AppAdminStore.allowLanguagesOnSettings;
|
||||
this.allowLanguagesOnSettings = ko.observable(!!settingsGet('AllowLanguagesOnSettings'));
|
||||
this.weakPassword = AppAdminStore.weakPassword;
|
||||
this.newMoveToFolder = AppAdminStore.newMoveToFolder;
|
||||
this.newMoveToFolder = ko.observable(!!settingsGet('NewMoveToFolder'));
|
||||
|
||||
this.dataFolderAccess = AppAdminStore.dataFolderAccess;
|
||||
|
||||
|
|
@ -83,19 +83,19 @@ class GeneralAdminSettings {
|
|||
setTimeout(() => this.languageAdminTrigger(SaveSettingsStep.Idle), 1000);
|
||||
};
|
||||
|
||||
this.mainAttachmentLimit.subscribe((value) => {
|
||||
this.mainAttachmentLimit.subscribe(value => {
|
||||
Remote.saveAdminConfig(f1, {
|
||||
'AttachmentLimit': pInt(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.language.subscribe((value) => {
|
||||
this.language.subscribe(value => {
|
||||
Remote.saveAdminConfig(f2, {
|
||||
'Language': value.trim()
|
||||
});
|
||||
});
|
||||
|
||||
this.languageAdmin.subscribe((value) => {
|
||||
this.languageAdmin.subscribe(value => {
|
||||
this.languageAdminTrigger(SaveSettingsStep.Animate);
|
||||
translatorReload(true, value)
|
||||
.then(fReloadLanguageHelper(SaveSettingsStep.TrueResult), fReloadLanguageHelper(SaveSettingsStep.FalseResult))
|
||||
|
|
@ -106,56 +106,56 @@ class GeneralAdminSettings {
|
|||
});
|
||||
});
|
||||
|
||||
this.theme.subscribe((value) => {
|
||||
this.theme.subscribe(value => {
|
||||
changeTheme(value, this.themeTrigger);
|
||||
Remote.saveAdminConfig(f3, {
|
||||
'Theme': value.trim()
|
||||
});
|
||||
});
|
||||
|
||||
this.capaAdditionalAccounts.subscribe((value) => {
|
||||
this.capaAdditionalAccounts.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaAdditionalAccounts': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaIdentities.subscribe((value) => {
|
||||
this.capaIdentities.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaIdentities': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaTemplates.subscribe((value) => {
|
||||
this.capaTemplates.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaTemplates': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaAttachmentThumbnails.subscribe((value) => {
|
||||
this.capaAttachmentThumbnails.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaAttachmentThumbnails': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaThemes.subscribe((value) => {
|
||||
this.capaThemes.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaThemes': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaUserBackground.subscribe((value) => {
|
||||
this.capaUserBackground.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaUserBackground': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.allowLanguagesOnSettings.subscribe((value) => {
|
||||
this.allowLanguagesOnSettings.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'AllowLanguagesOnSettings': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.newMoveToFolder.subscribe((value) => {
|
||||
this.newMoveToFolder.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'NewMoveToFolder': value ? '1' : '0'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,17 +2,16 @@ import ko from 'ko';
|
|||
|
||||
import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
||||
|
||||
import AppStore from 'Stores/Admin/App';
|
||||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
class LoginAdminSettings {
|
||||
constructor() {
|
||||
this.determineUserLanguage = AppStore.determineUserLanguage;
|
||||
this.determineUserDomain = AppStore.determineUserDomain;
|
||||
const settingsGet = rl.settings.get;
|
||||
this.determineUserLanguage = ko.observable(!!settingsGet('DetermineUserLanguage'));
|
||||
this.determineUserDomain = ko.observable(!!settingsGet('DetermineUserDomain'));
|
||||
|
||||
this.defaultDomain = ko.observable(rl.settings.get('LoginDefaultDomain')).idleTrigger();
|
||||
this.allowLanguagesOnLogin = AppStore.allowLanguagesOnLogin;
|
||||
this.defaultDomain = ko.observable(settingsGet('LoginDefaultDomain')).idleTrigger();
|
||||
this.allowLanguagesOnLogin = ko.observable(!!settingsGet('AllowLanguagesOnLogin'));
|
||||
|
||||
this.dummy = ko.observable(false);
|
||||
}
|
||||
|
|
@ -21,25 +20,25 @@ class LoginAdminSettings {
|
|||
setTimeout(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.defaultDomain.trigger, this);
|
||||
|
||||
this.determineUserLanguage.subscribe((value) => {
|
||||
this.determineUserLanguage.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'DetermineUserLanguage': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.determineUserDomain.subscribe((value) => {
|
||||
this.determineUserDomain.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'DetermineUserDomain': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.allowLanguagesOnLogin.subscribe((value) => {
|
||||
this.allowLanguagesOnLogin.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'AllowLanguagesOnLogin': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.defaultDomain.subscribe((value) => {
|
||||
this.defaultDomain.subscribe(value => {
|
||||
Remote.saveAdminConfig(f1, {
|
||||
'LoginDefaultDomain': value.trim()
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const settingsGet = rl.settings.get;
|
|||
|
||||
class SecurityAdminSettings {
|
||||
constructor() {
|
||||
this.useLocalProxyForExternalImages = AppAdminStore.useLocalProxyForExternalImages;
|
||||
this.useLocalProxyForExternalImages = ko.observable(!!rl.settings.get('UseLocalProxyForExternalImages'));
|
||||
|
||||
this.weakPassword = AppAdminStore.weakPassword;
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ class SecurityAdminSettings {
|
|||
this.capaTwoFactorAuth = CapaAdminStore.twoFactorAuth;
|
||||
this.capaTwoFactorAuthForce = CapaAdminStore.twoFactorAuthForce;
|
||||
|
||||
this.capaTwoFactorAuth.subscribe((value) => {
|
||||
this.capaTwoFactorAuth.subscribe(value => {
|
||||
if (!value) {
|
||||
this.capaTwoFactorAuthForce(false);
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ class SecurityAdminSettings {
|
|||
this.verifySslCertificate = ko.observable(!!settingsGet('VerifySslCertificate'));
|
||||
this.allowSelfSigned = ko.observable(!!settingsGet('AllowSelfSigned'));
|
||||
|
||||
this.verifySslCertificate.subscribe((value) => {
|
||||
this.verifySslCertificate.subscribe(value => {
|
||||
if (!value) {
|
||||
this.allowSelfSigned(true);
|
||||
}
|
||||
|
|
@ -123,37 +123,37 @@ class SecurityAdminSettings {
|
|||
}
|
||||
|
||||
onBuild() {
|
||||
this.capaOpenPGP.subscribe((value) => {
|
||||
this.capaOpenPGP.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaOpenPGP': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaTwoFactorAuth.subscribe((value) => {
|
||||
this.capaTwoFactorAuth.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaTwoFactorAuth': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.capaTwoFactorAuthForce.subscribe((value) => {
|
||||
this.capaTwoFactorAuthForce.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaTwoFactorAuthForce': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.useLocalProxyForExternalImages.subscribe((value) => {
|
||||
this.useLocalProxyForExternalImages.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'UseLocalProxyForExternalImages': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.verifySslCertificate.subscribe((value) => {
|
||||
this.verifySslCertificate.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'VerifySslCertificate': value ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
this.allowSelfSigned.subscribe((value) => {
|
||||
this.allowSelfSigned.subscribe(value => {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'AllowSelfSigned': value ? '1' : '0'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class GeneralUserSettings {
|
|||
this.threadsAllowed = AppStore.threadsAllowed;
|
||||
this.useThreads = SettingsStore.useThreads;
|
||||
this.replySameFolder = SettingsStore.replySameFolder;
|
||||
this.allowLanguagesOnSettings = AppStore.allowLanguagesOnSettings;
|
||||
this.allowLanguagesOnSettings = !!rl.settings.get('AllowLanguagesOnSettings');
|
||||
|
||||
this.languageFullName = ko.computed(() => convertLangName(this.language()));
|
||||
this.languageTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: 100 });
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class LoginUserView extends AbstractViewNext {
|
|||
|
||||
this.submitError.subscribe(value => value || this.submitErrorAddidional(''));
|
||||
|
||||
this.allowLanguagesOnLogin = AppStore.allowLanguagesOnLogin;
|
||||
this.allowLanguagesOnLogin = !!Settings.get('AllowLanguagesOnLogin');
|
||||
|
||||
this.langRequest = ko.observable(false);
|
||||
this.language = LanguageStore.language;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
this.iGoToUpUpOrDownDownTimeout = 0;
|
||||
|
||||
this.mobile = !!Settings.app('mobile');
|
||||
this.newMoveToFolder = AppStore.newMoveToFolder;
|
||||
this.newMoveToFolder = !!Settings.get('NewMoveToFolder');
|
||||
|
||||
this.allowReload = !!Settings.capa(Capa.Reload);
|
||||
this.allowSearch = !!Settings.capa(Capa.Search);
|
||||
|
|
@ -334,7 +334,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
|
||||
@command(canBeMovedHelper)
|
||||
moveNewCommand(vm, event) {
|
||||
if (this.newMoveToFolder() && this.mobileCheckedStateShow()) {
|
||||
if (this.newMoveToFolder && this.mobileCheckedStateShow()) {
|
||||
if (vm && event && event.preventDefault) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
|
@ -802,7 +802,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
if (Settings.capa(Capa.MessageListActions)) {
|
||||
// move
|
||||
shortcuts.add('insert', '', KeyState.MessageList, () => {
|
||||
if (this.newMoveToFolder()) {
|
||||
if (this.newMoveToFolder) {
|
||||
this.moveNewCommand();
|
||||
} else {
|
||||
this.moveDropdownTrigger(true);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
<div class="controls clearfix" style="margin-bottom: 10px">
|
||||
<div class="pull-right social-buttons">
|
||||
<a href="#" tabindex="-1" class="language-button"
|
||||
data-bind="visible: allowLanguagesOnLogin(), click: selectLanguage, tooltip: 'POPUPS_LANGUAGES/TITLE_LANGUAGES'">
|
||||
data-bind="visible: allowLanguagesOnLogin, click: selectLanguage, tooltip: 'POPUPS_LANGUAGES/TITLE_LANGUAGES'">
|
||||
<i data-bind="css: langRequest() ? 'icon-spinner animated' : 'icon-world'"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="btn-group" data-bind="visible: allowReload && mobileCheckedStateHide()"> </div>
|
||||
<!-- ko if: !newMoveToFolder() -->
|
||||
<!-- ko if: !newMoveToFolder -->
|
||||
<div class="btn-group dropdown colored-toggle hide-on-mobile" data-bind="visible: allowMessageListActions, registrateBootstrapDropdown: true, openDropdownTrigger: moveDropdownTrigger">
|
||||
<a id="move-dropdown-id" href="#" tabindex="-1" class="btn single btn-dark-disabled-border dropdown-toggle buttonMove" data-toggle="dropdown" data-bind="command: moveCommand, tooltip: 'MESSAGE_LIST/BUTTON_MOVE_TO'">
|
||||
<i class="icon-copy visible-on-ctrl-btn"></i>
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: newMoveToFolder() -->
|
||||
<!-- ko if: newMoveToFolder -->
|
||||
<div class="btn-group" data-bind="visible: allowMessageListActions && mobileCheckedStateShow()">
|
||||
<a id="move-dropdown-id" href="#" tabindex="-1" class="btn single btn-dark-disabled-border buttonMove" data-bind="command: moveNewCommand, tooltip: 'MESSAGE_LIST/BUTTON_MOVE_TO'">
|
||||
<i class="icon-copy visible-on-ctrl-btn"></i>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue