mirror of
https://github.com/SupertigerDev/waybar-online.git
synced 2026-03-24 08:06:37 +00:00
Refactor pathname handling for improved readability and consistency
This commit is contained in:
@@ -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 }) =>
|
import("./routes/waybar/waybar").then(({ createWaybarPage }) =>
|
||||||
createWaybarPage()
|
createWaybarPage()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location.pathname === import.meta.env.BASE_URL) {
|
if (pathname === import.meta.env.BASE_URL) {
|
||||||
import("./routes/root/root").then(({ createRootPage }) => createRootPage());
|
import("./routes/root/root").then(({ createRootPage }) => createRootPage());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user