mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 06:27:02 +03:00
Move Knoin routOff, routOn, routReload & setHash to rl.route.*
This commit is contained in:
parent
03a40f3249
commit
467f615713
17 changed files with 83 additions and 111 deletions
|
|
@ -14,8 +14,6 @@ import { initOnStartOrLangChange, initNotificationLanguage } from 'Common/Transl
|
|||
import LanguageStore from 'Stores/Language';
|
||||
import ThemeStore from 'Stores/Theme';
|
||||
|
||||
import { routeReload } from 'Knoin/Knoin';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
||||
class AbstractApp {
|
||||
|
|
@ -89,7 +87,7 @@ class AbstractApp {
|
|||
if (location.href !== logoutLink) {
|
||||
setTimeout(() => (Settings.app('inIframe') ? parent : window).location.href = logoutLink, 100);
|
||||
} else {
|
||||
routeReload();
|
||||
rl.route.reload();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { root } from 'Common/Links';
|
||||
import { StorageResultType } from 'Common/Enums';
|
||||
|
||||
import AppStore from 'Stores/Admin/App';
|
||||
|
|
@ -13,7 +12,7 @@ import Remote from 'Remote/Admin/Fetch';
|
|||
import { SettingsAdminScreen } from 'Screen/Admin/Settings';
|
||||
import { LoginAdminScreen } from 'Screen/Admin/Login';
|
||||
|
||||
import { hideLoading, routeOff, setHash, startScreens } from 'Knoin/Knoin';
|
||||
import { hideLoading, startScreens } from 'Knoin/Knoin';
|
||||
import { AbstractApp } from 'App/Abstract';
|
||||
|
||||
class AdminApp extends AbstractApp {
|
||||
|
|
@ -108,13 +107,8 @@ class AdminApp extends AbstractApp {
|
|||
hideLoading();
|
||||
|
||||
if (!rl.settings.app('allowAdminPanel')) {
|
||||
routeOff();
|
||||
setHash(root(), true);
|
||||
routeOff();
|
||||
|
||||
setTimeout(() =>
|
||||
location.href = '/'
|
||||
, 1);
|
||||
rl.route.root();
|
||||
setTimeout(() => location.href = '/', 1);
|
||||
} else {
|
||||
if (rl.settings.get('Auth')) {
|
||||
startScreens([SettingsAdminScreen]);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ import { LoginUserScreen } from 'Screen/User/Login';
|
|||
import { MailBoxUserScreen } from 'Screen/User/MailBox';
|
||||
import { SettingsUserScreen } from 'Screen/User/Settings';
|
||||
|
||||
import { hideLoading, routeOff, routeOn, setHash, startScreens, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { hideLoading, startScreens, showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import { AbstractApp } from 'App/Abstract';
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ class AppUser extends AbstractApp {
|
|||
MessageStore.messageListPageBeforeThread(1);
|
||||
iOffset = 0;
|
||||
|
||||
setHash(
|
||||
rl.route.setHash(
|
||||
mailBox(
|
||||
FolderStore.currentFolderFullNameHash(),
|
||||
MessageStore.messageListPage(),
|
||||
|
|
@ -948,9 +948,7 @@ class AppUser extends AbstractApp {
|
|||
|
||||
if (value) {
|
||||
if (startupUrl) {
|
||||
routeOff();
|
||||
setHash(root(startupUrl), true);
|
||||
routeOn();
|
||||
rl.route.setHash(root(startupUrl), true);
|
||||
}
|
||||
|
||||
if (window.crypto && crypto.getRandomValues && Settings.capa(Capa.OpenPGP)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue