From cbd8f3e758742494a0798dbf865de11adb33e450 Mon Sep 17 00:00:00 2001 From: Gary Kim Date: Tue, 12 May 2020 02:11:26 +0800 Subject: [PATCH] Fix login page issue Currently, the user is sent to the login page when disable_custom_urls is set regardless of whether they are logged in or not. This fixes that issue. Signed-off-by: Gary Kim --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 5db20343..91904f53 100644 --- a/src/main.js +++ b/src/main.js @@ -34,7 +34,7 @@ function main () { originalTitle = document.title; iframe = document.getElementById('riot-iframe'); - if (!window.location.hash && loadState('riotchat', 'disable_custom_urls') === 'true') { + if (!window.location.hash && loadState('riotchat', 'disable_custom_urls') === 'true' && !window.localStorage.getItem('mx_user_id')) { iframe.src = generateUrl('/apps/riotchat/riot/') + '#/login'; window.location.hash = '#/login'; } else {