From b98e280e92707247703163c342eacdc6854e1902 Mon Sep 17 00:00:00 2001 From: Supertiger Date: Fri, 1 Aug 2025 18:25:28 +0100 Subject: [PATCH] Refactor pathname handling for improved readability and consistency --- src/main.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 6316ccd..3faebab 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,13 @@ -if (location.pathname === import.meta.env.BASE_URL + "/waybar") { +const pathname = location.pathname.endsWith("/") + ? location.pathname.slice(0, -1) + : location.pathname; + +if (pathname === import.meta.env.BASE_URL + "/waybar") { import("./routes/waybar/waybar").then(({ createWaybarPage }) => createWaybarPage() ); } -if (location.pathname === import.meta.env.BASE_URL) { +if (pathname === import.meta.env.BASE_URL) { import("./routes/root/root").then(({ createRootPage }) => createRootPage()); }