mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-10-23 08:32:25 +00:00
fixes
This commit is contained in:
1 parent
3b57cb703e
commit
c2e41ec085
3 files changed
+7
-14
No files matched your search
@@ -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;
|
||||
}
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+5
-12
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user