]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix `/web` redirecting to `/web/web` in web UI
authorThibG <thib@sitedethib.com>
Sat, 22 Feb 2020 00:27:34 +0000 (01:27 +0100)
committerThibaut Girka <thib@sitedethib.com>
Tue, 25 Feb 2020 13:30:43 +0000 (14:30 +0100)
Port 0f07218e53bf581127cdcf5fbf12d9c207ace8d7 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/util/main.js

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