From 57a38f071b0ffd74b813516e24c9e86a23c4d467 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 19 Sep 2024 16:58:33 +0200 Subject: [PATCH] Fix custom `history.push` and `history.replace` building bogus location if path is omitted (#31980) --- app/javascript/mastodon/components/router.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/router.tsx b/app/javascript/mastodon/components/router.tsx index 33fb60abb7..558d0307e7 100644 --- a/app/javascript/mastodon/components/router.tsx +++ b/app/javascript/mastodon/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}`; }