mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
When login don't reload the whole browser. Just rebuilt screens
This commit is contained in:
parent
d3500e2921
commit
e52addf346
16 changed files with 74 additions and 57 deletions
|
|
@ -1,9 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import {
|
||||
elementById,
|
||||
Settings
|
||||
} from 'Common/Globals';
|
||||
import { Settings, SettingsGet } from 'Common/Globals';
|
||||
|
||||
import { logoutLink } from 'Common/Links';
|
||||
import { i18nToNodes, initOnStartOrLangChange } from 'Common/Translator';
|
||||
|
|
@ -37,6 +34,12 @@ export class AbstractApp {
|
|||
}
|
||||
}
|
||||
|
||||
refresh() {
|
||||
// rl.adminArea() || !translatorReload(false, );
|
||||
rl.adminArea() || LanguageStore.language(SettingsGet('Language'));
|
||||
this.start();
|
||||
}
|
||||
|
||||
bootstart() {
|
||||
const register = (key, ClassObject, templateID) => ko.components.register(key, {
|
||||
template: { element: templateID || (key + 'Component') },
|
||||
|
|
@ -68,14 +71,7 @@ export class AbstractApp {
|
|||
|
||||
LanguageStore.populate();
|
||||
ThemeStore.populate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
hideLoading() {
|
||||
elementById('rl-content').hidden = false;
|
||||
elementById('rl-loading').remove();
|
||||
this.start();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ class AdminApp extends AbstractApp {
|
|||
this.weakPassword = ko.observable(false);
|
||||
}
|
||||
|
||||
bootstart() {
|
||||
super.bootstart();
|
||||
start() {
|
||||
if (!Settings.app('allowAdminPanel')) {
|
||||
rl.route.root();
|
||||
setTimeout(() => location.href = '/', 1);
|
||||
|
|
@ -27,7 +26,6 @@ class AdminApp extends AbstractApp {
|
|||
} else {
|
||||
startScreens([LoginAdminScreen]);
|
||||
}
|
||||
this.hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import 'External/User/ko';
|
||||
|
||||
import { isArray, arrayLength, pInt, pString } from 'Common/Utils';
|
||||
import { isArray, arrayLength, pInt, pString, forEachObjectValue } from 'Common/Utils';
|
||||
import { isPosNumeric, delegateRunOnDestroy, mailToHelper } from 'Common/UtilsUser';
|
||||
|
||||
import {
|
||||
|
|
@ -187,7 +187,7 @@ class AppUser extends AbstractApp {
|
|||
const sTrashFolder = FolderUserStore.trashFolder(),
|
||||
sSpamFolder = FolderUserStore.spamFolder();
|
||||
|
||||
Object.values(this.moveCache).forEach(item => {
|
||||
forEachObjectValue(this.moveCache, item => {
|
||||
const isSpam = sSpamFolder === item.To,
|
||||
isTrash = sTrashFolder === item.To,
|
||||
isHam = !isSpam && sSpamFolder === item.From && getFolderInboxName() === item.To;
|
||||
|
|
@ -810,7 +810,9 @@ class AppUser extends AbstractApp {
|
|||
return event.returnValue = "Are you sure you want to exit?";
|
||||
}
|
||||
}, {capture: true});
|
||||
}
|
||||
|
||||
start() {
|
||||
if (SettingsGet('Auth')) {
|
||||
rl.setWindowTitle(i18n('GLOBAL/LOADING'));
|
||||
|
||||
|
|
@ -830,7 +832,6 @@ class AppUser extends AbstractApp {
|
|||
MailBoxUserScreen,
|
||||
SettingsUserScreen
|
||||
]);
|
||||
this.hideLoading();
|
||||
|
||||
setInterval(() => {
|
||||
const cF = FolderUserStore.currentFolderFullNameRaw(),
|
||||
|
|
@ -916,7 +917,6 @@ class AppUser extends AbstractApp {
|
|||
|
||||
} else {
|
||||
startScreens([LoginUserScreen]);
|
||||
this.hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue