feat: replace account actions with menu
This commit is contained in:
+2
-7
@@ -690,13 +690,8 @@ async function init() {
|
||||
fetch("/api/auth/me")
|
||||
.then((r) => (r.ok ? r.json() : null))
|
||||
.then((body) => {
|
||||
if (body?.user?.role === "admin") {
|
||||
const button = document.getElementById("btn-admin");
|
||||
button.classList.remove("hidden");
|
||||
button.onclick = () => {
|
||||
location.href = "/admin";
|
||||
};
|
||||
}
|
||||
if (body?.user?.role === "admin")
|
||||
document.getElementById("menu-admin").classList.remove("hidden");
|
||||
})
|
||||
.catch(() => {});
|
||||
initPrefillPanel({
|
||||
|
||||
Reference in New Issue
Block a user