Refactor pathname handling for improved readability and consistency

This commit is contained in:
Supertiger
2025-08-01 18:25:28 +01:00
parent 224e6ed9fd
commit b98e280e92

View File

@@ -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());
}