Skip to content

Commit c2e41ec

Browse files
committed
fixes
1 parent 3b57cb7 commit c2e41ec

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

src/webpage/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {I18n} from "./i18n.js";
1111
await I18n.done;
1212

1313
if (!(sessionStorage.getItem("currentuser") || Localuser.users.currentuser)) {
14-
window.location.href = "/login.html";
14+
window.location.href = "/login";
1515
return;
1616
}
1717
{

src/webpage/localuser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class Localuser {
136136
switchAccountDiv.classList.add("switchtable");
137137
switchAccountDiv.textContent = I18n.getTranslation("switchAccounts");
138138
switchAccountDiv.addEventListener("click", () => {
139-
window.location.href = "/login.html";
139+
window.location.href = "/login";
140140
});
141141
table.append(switchAccountDiv);
142142

src/webpage/service.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,19 @@ function samedomain(url: string | URL) {
5656
let enabled = "false";
5757
let offline = false;
5858

59-
const htmlFiles = new Set(["/app", "/login", "/home", "/register", "/oauth2/auth", "/reset"]);
60-
function isHtml(url: string): string | void {
61-
const path = new URL(url).pathname;
62-
if (htmlFiles.has(path) || htmlFiles.has(path + ".html")) {
63-
return path + path.endsWith(".html") ? "" : ".html";
64-
}
65-
}
6659
function toPath(url: string): string {
6760
const Url = new URL(url);
68-
let html = isHtml(url);
61+
let html: string | undefined = undefined;
6962
if (!html) {
7063
const path = Url.pathname;
7164
if (path.startsWith("/channels")) {
72-
html = "./app.html";
65+
html = "./app";
7366
} else if (path.startsWith("/invite/") || path === "/invite") {
74-
html = "./invite.html";
67+
html = "./invite";
7568
} else if (path.startsWith("/template/") || path === "/template") {
76-
html = "./template.html";
69+
html = "./template";
7770
} else if (path === "/") {
78-
html = "./home.html";
71+
html = "./home";
7972
}
8073
}
8174
return html || Url.pathname;

0 commit comments

Comments
 (0)