mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 17:10:10 +00:00
userpage: hide bg on login, dont refresh page ever
This commit is contained in:
parent
757c3a8aed
commit
4e7f720214
@ -69,7 +69,7 @@
|
|||||||
<span class="button ~warning" alt="{{ .strings.theme }}" id="button-theme"><i class="ri-sun-line"></i></span>
|
<span class="button ~warning" alt="{{ .strings.theme }}" id="button-theme"><i class="ri-sun-line"></i></span>
|
||||||
<span class="button ~critical @low mb-4 unfocused" id="logout-button">{{ .strings.logout }}</span>
|
<span class="button ~critical @low mb-4 unfocused" id="logout-button">{{ .strings.logout }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-container">
|
<div class="page-container unfocused">
|
||||||
<div class="card @low dark:~d_neutral mb-4" id="card-user">
|
<div class="card @low dark:~d_neutral mb-4" id="card-user">
|
||||||
<span class="heading mb-2"></span>
|
<span class="heading mb-2"></span>
|
||||||
</div>
|
</div>
|
||||||
|
11
ts/user.ts
11
ts/user.ts
@ -175,7 +175,7 @@ class ContactMethods {
|
|||||||
const deleteButton = row.querySelector(".user-contact-delete") as HTMLButtonElement;
|
const deleteButton = row.querySelector(".user-contact-delete") as HTMLButtonElement;
|
||||||
deleteButton.onclick = () => _delete("/my/" + name, null, (req: XMLHttpRequest) => {
|
deleteButton.onclick = () => _delete("/my/" + name, null, (req: XMLHttpRequest) => {
|
||||||
if (req.readyState != 4) return;
|
if (req.readyState != 4) return;
|
||||||
window.location.reload();
|
document.dispatchEvent(new CustomEvent("details-reload"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,7 +289,7 @@ const addEditEmail = (add: boolean): void => {
|
|||||||
toggleLoader(submit);
|
toggleLoader(submit);
|
||||||
_post("/my/email", {"email": input.value}, (req: XMLHttpRequest) => {
|
_post("/my/email", {"email": input.value}, (req: XMLHttpRequest) => {
|
||||||
if (req.readyState == 4 && (req.status == 303 || req.status == 200)) {
|
if (req.readyState == 4 && (req.status == 303 || req.status == 200)) {
|
||||||
window.location.reload();
|
document.dispatchEvent(new CustomEvent("details-reload"));
|
||||||
}
|
}
|
||||||
}, true, (req: XMLHttpRequest) => {
|
}, true, (req: XMLHttpRequest) => {
|
||||||
if (req.readyState == 4 && req.status == 401) {
|
if (req.readyState == 4 && req.status == 401) {
|
||||||
@ -312,7 +312,7 @@ const discordConf: ServiceConfiguration = {
|
|||||||
accountLinkedError: window.lang.notif("errorAccountLinked"),
|
accountLinkedError: window.lang.notif("errorAccountLinked"),
|
||||||
successError: window.lang.notif("verified"),
|
successError: window.lang.notif("verified"),
|
||||||
successFunc: (modalClosed: boolean) => {
|
successFunc: (modalClosed: boolean) => {
|
||||||
if (modalClosed) window.location.reload();
|
if (modalClosed) document.dispatchEvent(new CustomEvent("details-reload"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ const telegramConf: ServiceConfiguration = {
|
|||||||
accountLinkedError: window.lang.notif("errorAccountLinked"),
|
accountLinkedError: window.lang.notif("errorAccountLinked"),
|
||||||
successError: window.lang.notif("verified"),
|
successError: window.lang.notif("verified"),
|
||||||
successFunc: (modalClosed: boolean) => {
|
successFunc: (modalClosed: boolean) => {
|
||||||
if (modalClosed) window.location.reload();
|
if (modalClosed) document.dispatchEvent(new CustomEvent("details-reload"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -342,7 +342,7 @@ const matrixConf: MatrixConfiguration = {
|
|||||||
unknownError: window.lang.notif("errorUnknown"),
|
unknownError: window.lang.notif("errorUnknown"),
|
||||||
successError: window.lang.notif("verified"),
|
successError: window.lang.notif("verified"),
|
||||||
successFunc: () => {
|
successFunc: () => {
|
||||||
setTimeout(() => window.location.reload(), 1200);
|
setTimeout(() => document.dispatchEvent(new CustomEvent("details-reload")), 1200);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -431,6 +431,7 @@ document.addEventListener("details-reload", () => {
|
|||||||
const login = new Login(window.modals.login as Modal, "/my/");
|
const login = new Login(window.modals.login as Modal, "/my/");
|
||||||
login.onLogin = () => {
|
login.onLogin = () => {
|
||||||
console.log("Logged in.");
|
console.log("Logged in.");
|
||||||
|
document.querySelector(".page-container").classList.remove("unfocused");
|
||||||
document.dispatchEvent(new CustomEvent("details-reload"));
|
document.dispatchEvent(new CustomEvent("details-reload"));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user