From 5c1cf64c4c2bd39ca50f44fca08c9f3b0a2e9791 Mon Sep 17 00:00:00 2001 From: Geert Rademakes Date: Fri, 25 Apr 2025 10:01:45 +0200 Subject: [PATCH] Routing fixes --- packages/frontend/src/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/App.tsx b/packages/frontend/src/App.tsx index 8646dd0..46376bb 100644 --- a/packages/frontend/src/App.tsx +++ b/packages/frontend/src/App.tsx @@ -129,9 +129,9 @@ export default function RekordboxReader() { const resizeRef = useRef<{ startX: number; startWidth: number } | null>(null); // Get the current playlist from URL or default to "All Songs" - const currentPlaylist = location.pathname === "/" - ? "All Songs" - : decodeURIComponent(location.pathname.slice(1)); + const currentPlaylist = location.pathname.startsWith("/playlists/") + ? decodeURIComponent(location.pathname.slice("/playlists/".length)) + : "All Songs"; useEffect(() => { // Only run this check after the initial data load @@ -154,7 +154,7 @@ export default function RekordboxReader() { } else { // Use encodeURIComponent to properly handle spaces and special characters const encodedName = encodeURIComponent(name); - navigate(`/${encodedName}`); + navigate(`/playlists/${encodedName}`); } };