aboutsummaryrefslogtreecommitdiff
path: root/client-web/source/preferences/ui.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-09-11 09:52:29 +0200
committermetamuffin <metamuffin@disroot.org>2022-09-11 09:52:29 +0200
commit38dd237bf0dd21ad83e2b127a0f4054b065d7d49 (patch)
tree044149c4d1538669674d8cc22e84d22f05c0c4cf /client-web/source/preferences/ui.ts
parenta47a937c8058eb88d95ff4a006d159ae63b08e9e (diff)
downloadkeks-meet-38dd237bf0dd21ad83e2b127a0f4054b065d7d49.tar
keks-meet-38dd237bf0dd21ad83e2b127a0f4054b065d7d49.tar.bz2
keks-meet-38dd237bf0dd21ad83e2b127a0f4054b065d7d49.tar.zst
prefs in localStorage
Diffstat (limited to 'client-web/source/preferences/ui.ts')
-rw-r--r--client-web/source/preferences/ui.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/client-web/source/preferences/ui.ts b/client-web/source/preferences/ui.ts
index 72d7792..634d945 100644
--- a/client-web/source/preferences/ui.ts
+++ b/client-web/source/preferences/ui.ts
@@ -4,8 +4,6 @@ import { change_pref, on_pref_changed, PrefDecl, PREFS } from "./mod.ts";
export class PrefUi extends OverlayUi {
constructor() {
- console.log(PREFS);
-
const rows = Object.entries(PREF_DECLS as Record<string, PrefDecl<unknown>>).filter(e => !e[1].hidden).map(([key_, decl]) => {
const key = key_ as keyof typeof PREF_DECLS
const id = `pref-${key}`
@@ -77,14 +75,20 @@ export class PrefUi extends OverlayUi {
const label = elabel(decl.description ?? `[${key}]`, { id })
return etr({ class: "pref" }, etd({}, label), etd({}, use_opt_ ?? ""), etd({}, prim_control ?? ""))
})
+
const notification_perm = Notification.permission == "granted" ? ediv() : ediv({},
espan("For keks-meet to send notifications, it needs you to grant permission: "),
ebutton("Grant", { onclick: () => Notification.requestPermission() }),
)
+ const reset = ediv({},
+ espan("Want to clear all settings? Use this:"),
+ ebutton("RESET", { onclick: () => { if (confirm("really clear all preferences?")) { localStorage.clear(); window.location.reload() } } }),
+ )
+
const table = document.createElement("table")
table.append(...rows)
- super(ediv({ class: "prefs-overlay" }, notification_perm, ebr(), table))
+ super(ediv({ class: "prefs-overlay" }, notification_perm, reset, ebr(), table))
}
}