fies
This commit is contained in:
+11
-1
@@ -84,7 +84,16 @@ document.querySelector("#workspace-form").addEventListener("submit", async (even
|
||||
|
||||
handleAccountConfirmationToken();
|
||||
handleResetToken();
|
||||
{ const params=new URLSearchParams(location.search); const token=params.get("account_action_token"); if(token){ api("/api/auth/account-action/confirm",{method:"POST",body:JSON.stringify({token})}).then(r=>alert(r.message)).catch(e=>alert(e.message)).finally(()=>{params.delete("account_action_token");history.replaceState({},"",`${location.pathname}${params.size?`?${params}`:""}${location.hash}`);}); } }
|
||||
function toast(text) {
|
||||
const element = document.querySelector("#toast");
|
||||
if (!element) return;
|
||||
element.textContent = text;
|
||||
element.classList.add("visible");
|
||||
clearTimeout(toast.timer);
|
||||
toast.timer = setTimeout(() => element.classList.remove("visible"), 3000);
|
||||
}
|
||||
|
||||
{ const params=new URLSearchParams(location.search); const token=params.get("account_action_token"); if(token){ api("/api/auth/account-action/confirm",{method:"POST",body:JSON.stringify({token})}).then(r=>toast(r.message)).catch(e=>toast(e.message)).finally(()=>{params.delete("account_action_token");history.replaceState({},"",`${location.pathname}${params.size?`?${params}`:""}${location.hash}`);}); } }
|
||||
|
||||
const identityDialog = document.querySelector("#identity-dialog");
|
||||
const guestAccount = document.querySelector("#footer-account-guest");
|
||||
@@ -260,6 +269,7 @@ if (identityDialog) {
|
||||
|
||||
document.querySelector("#footer-profile")?.addEventListener("click", () => {
|
||||
document.querySelector("#profile-nickname").value = currentSession?.nickname || "";
|
||||
document.querySelector("#profile-current-email").value = currentSession?.email || "";
|
||||
document.querySelector("#profile-email").value = "";
|
||||
document.querySelector("#profile-new-password").value = "";
|
||||
document.querySelector("#profile-password").value = "";
|
||||
|
||||
Reference in New Issue
Block a user