This commit is contained in:
djmaze 2021-01-27 12:02:37 +01:00
parent 3983932bc0
commit aa05f10629
5 changed files with 29 additions and 31 deletions

View file

@ -8,7 +8,7 @@ import {
} from 'Common/Globals';
import { KeyState } from 'Common/Enums';
import { rootAdmin, rootUser } from 'Common/Links';
import { logoutLink } from 'Common/Links';
import { i18nToNodes, initOnStartOrLangChange } from 'Common/Translator';
import { LanguageStore } from 'Stores/Language';
@ -70,13 +70,13 @@ export class AbstractApp {
}
logoutReload(close = false) {
const logoutLink = rl.adminArea() ? rootAdmin() : rootUser();
const url = logoutLink();
rl.hash.clear();
close && window.close && window.close();
if (location.href !== logoutLink) {
setTimeout(() => (Settings.app('inIframe') ? parent : window).location.href = logoutLink, 100);
if (location.href !== url) {
setTimeout(() => (Settings.app('inIframe') ? parent : window).location.href = url, 100);
} else {
rl.route.reload();
}

View file

@ -5,7 +5,6 @@ const
ROOT = './',
HASH_PREFIX = '#/',
SERVER_PREFIX = './?',
SUB_QUERY_PREFIX = '&q[]=',
VERSION = Settings.app('version'),
VERSION_PREFIX = Settings.app('webVersionPath') || 'snappymail/v/' + VERSION + '/',
@ -14,9 +13,7 @@ const
/**
* @returns {string}
*/
export function subQueryPrefix() {
return SUB_QUERY_PREFIX;
}
export const SUB_QUERY_PREFIX = '&q[]=';
/**
* @param {string=} startupUrl
@ -36,8 +33,8 @@ export function rootAdmin() {
/**
* @returns {string}
*/
export function rootUser() {
return ROOT;
export function logoutLink() {
return rl.adminArea() ? rootAdmin() : ROOT;
}
/**

View file

@ -8,7 +8,7 @@ import {
MessageFlagsCache
} from 'Common/Cache';
import { subQueryPrefix } from 'Common/Links';
import { SUB_QUERY_PREFIX } from 'Common/Links';
import AppStore from 'Stores/User/App';
import SettingsStore from 'Stores/User/Settings';
@ -314,7 +314,7 @@ class RemoteUserFetch extends AbstractFetchRemote {
if (folderHash && (!sSearch || !sSearch.includes('is:'))) {
sGetAdd = 'MessageList/' +
subQueryPrefix() +
SUB_QUERY_PREFIX +
'/' +
urlsafeArray([
sFolderFullNameRaw,
@ -381,7 +381,7 @@ class RemoteUserFetch extends AbstractFetchRemote {
{},
null,
'Message/' +
subQueryPrefix() +
SUB_QUERY_PREFIX +
'/' +
urlsafeArray([
sFolderFullNameRaw,