[Glitch] Fix `/web` redirecting to `/web/web` in web UI

Port 0f07218e53 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
rebase/4.0.0rc2
ThibG 2020-02-22 01:27:34 +01:00 committed by Thibaut Girka
parent 85933bc9ff
commit 2f2b48b227
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ function main() {
if (window.history && history.replaceState) { if (window.history && history.replaceState) {
const { pathname, search, hash } = window.location; const { pathname, search, hash } = window.location;
const path = pathname + search + hash; const path = pathname + search + hash;
if (!(/^\/web[$/]/).test(path)) { if (!(/^\/web($|\/)/).test(path)) {
history.replaceState(null, document.title, `/web${path}`); history.replaceState(null, document.title, `/web${path}`);
} }
} }