mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-27 09:36:09 +08:00
Cleanup AppUser and AdminApp
This commit is contained in:
parent
cf3801cba0
commit
893364d52d
5 changed files with 20 additions and 24 deletions
|
@ -1,7 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { Settings, SettingsGet } from 'Common/Globals';
|
||||
import { changeTheme } from 'Common/Utils';
|
||||
import { Settings } from 'Common/Globals';
|
||||
|
||||
import { logoutLink } from 'Common/Links';
|
||||
import { i18nToNodes, initOnStartOrLangChange } from 'Common/Translator';
|
||||
|
@ -33,17 +32,6 @@ export class AbstractApp {
|
|||
}
|
||||
}
|
||||
|
||||
refresh() {
|
||||
// rl.adminArea() || !translatorReload(false, );
|
||||
rl.adminArea() || (
|
||||
LanguageStore.language(SettingsGet('Language'))
|
||||
& ThemeStore.populate()
|
||||
& changeTheme(SettingsGet('Theme'))
|
||||
);
|
||||
|
||||
this.start();
|
||||
}
|
||||
|
||||
bootstart() {
|
||||
const register = (key, ClassObject, templateID) => ko.components.register(key, {
|
||||
template: { element: templateID || (key + 'Component') },
|
||||
|
|
|
@ -10,12 +10,16 @@ import { LoginAdminScreen } from 'Screen/Admin/Login';
|
|||
import { startScreens } from 'Knoin/Knoin';
|
||||
import { AbstractApp } from 'App/Abstract';
|
||||
|
||||
class AdminApp extends AbstractApp {
|
||||
export class AdminApp extends AbstractApp {
|
||||
constructor() {
|
||||
super(Remote);
|
||||
this.weakPassword = ko.observable(false);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
this.start();
|
||||
}
|
||||
|
||||
start() {
|
||||
if (!Settings.app('adminAllowed')) {
|
||||
rl.route.root();
|
||||
|
@ -28,5 +32,3 @@ class AdminApp extends AbstractApp {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default new AdminApp();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'External/User/ko';
|
||||
|
||||
import { isArray, pString } from 'Common/Utils';
|
||||
import { isArray, pString, changeTheme } from 'Common/Utils';
|
||||
import { mailToHelper, setLayoutResizer, dropdownsDetectVisibility } from 'Common/UtilsUser';
|
||||
|
||||
import {
|
||||
|
@ -41,6 +41,7 @@ import { FolderUserStore } from 'Stores/User/Folder';
|
|||
import { PgpUserStore } from 'Stores/User/Pgp';
|
||||
import { MessagelistUserStore } from 'Stores/User/Messagelist';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
import { LanguageStore } from 'Stores/Language';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
|
@ -68,7 +69,7 @@ import {
|
|||
} from 'Common/Folders';
|
||||
import { loadFolders } from 'Model/FolderCollection';
|
||||
|
||||
class AppUser extends AbstractApp {
|
||||
export class AppUser extends AbstractApp {
|
||||
constructor() {
|
||||
super(Remote);
|
||||
|
||||
|
@ -93,6 +94,13 @@ class AppUser extends AbstractApp {
|
|||
addEventListener('click', dropdownsDetectVisibility);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
LanguageStore.language(SettingsGet('Language'));
|
||||
ThemeStore.populate();
|
||||
changeTheme(SettingsGet('Theme'));
|
||||
this.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} iDeleteType
|
||||
* @param {string} sFromFolderFullName
|
||||
|
@ -376,5 +384,3 @@ class AppUser extends AbstractApp {
|
|||
showScreenPopup(ComposePopupView, params);
|
||||
}
|
||||
}
|
||||
|
||||
export default new AppUser();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bootstrap from 'bootstrap';
|
||||
import App from 'App/Admin';
|
||||
import { AdminApp } from 'App/Admin';
|
||||
|
||||
bootstrap(App);
|
||||
bootstrap(new AdminApp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bootstrap from 'bootstrap';
|
||||
import App from 'App/User';
|
||||
import { AppUser } from 'App/User';
|
||||
|
||||
bootstrap(App);
|
||||
bootstrap(new AppUser);
|
||||
|
|
Loading…
Reference in a new issue