diff --git a/src/webpage/index.ts b/src/webpage/index.ts index dfdf120..dc3803d 100644 --- a/src/webpage/index.ts +++ b/src/webpage/index.ts @@ -11,7 +11,7 @@ import {I18n} from "./i18n.js"; await I18n.done; if (!(sessionStorage.getItem("currentuser") || Localuser.users.currentuser)) { - window.location.href = "/login.html"; + window.location.href = "/login"; return; } { diff --git a/src/webpage/localuser.ts b/src/webpage/localuser.ts index 69f5a76..932caea 100644 --- a/src/webpage/localuser.ts +++ b/src/webpage/localuser.ts @@ -136,7 +136,7 @@ class Localuser { switchAccountDiv.classList.add("switchtable"); switchAccountDiv.textContent = I18n.getTranslation("switchAccounts"); switchAccountDiv.addEventListener("click", () => { - window.location.href = "/login.html"; + window.location.href = "/login"; }); table.append(switchAccountDiv); diff --git a/src/webpage/service.ts b/src/webpage/service.ts index 0eb1f21..58c4020 100644 --- a/src/webpage/service.ts +++ b/src/webpage/service.ts @@ -56,26 +56,19 @@ function samedomain(url: string | URL) { let enabled = "false"; let offline = false; -const htmlFiles = new Set(["/app", "/login", "/home", "/register", "/oauth2/auth", "/reset"]); -function isHtml(url: string): string | void { - const path = new URL(url).pathname; - if (htmlFiles.has(path) || htmlFiles.has(path + ".html")) { - return path + path.endsWith(".html") ? "" : ".html"; - } -} function toPath(url: string): string { const Url = new URL(url); - let html = isHtml(url); + let html: string | undefined = undefined; if (!html) { const path = Url.pathname; if (path.startsWith("/channels")) { - html = "./app.html"; + html = "./app"; } else if (path.startsWith("/invite/") || path === "/invite") { - html = "./invite.html"; + html = "./invite"; } else if (path.startsWith("/template/") || path === "/template") { - html = "./template.html"; + html = "./template"; } else if (path === "/") { - html = "./home.html"; + html = "./home"; } } return html || Url.pathname;