From 86b9d3b4e5f95be5a97924e4787a92112c6e6f11 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 19 Sep 2024 16:58:33 +0200 Subject: [PATCH] [Glitch] Fix custom `history.push` and `history.replace` building bogus location if path is omitted Port 57a38f071b0ffd74b813516e24c9e86a23c4d467 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/router.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/components/router.tsx b/app/javascript/flavours/glitch/components/router.tsx index 48f35d8aed..46477b96ff 100644 --- a/app/javascript/flavours/glitch/components/router.tsx +++ b/app/javascript/flavours/glitch/components/router.tsx @@ -51,7 +51,8 @@ function normalizePath( if ( layoutFromWindow() === 'multi-column' && - !location.pathname?.startsWith('/deck') + location.pathname && + !location.pathname.startsWith('/deck') ) { location.pathname = `/deck${location.pathname}`; }