From f268bd2087fbfb57b8504becf364a00ddebde075 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 10 Sep 2022 18:22:46 +0200 Subject: notifications for chat --- client-web/source/preferences/ui.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'client-web/source/preferences/ui.ts') diff --git a/client-web/source/preferences/ui.ts b/client-web/source/preferences/ui.ts index 1aaaca0..3461da9 100644 --- a/client-web/source/preferences/ui.ts +++ b/client-web/source/preferences/ui.ts @@ -1,4 +1,4 @@ -import { ediv, elabel, espan, OverlayUi } from "../helper.ts"; +import { ebr, ebutton, ediv, elabel, espan, OverlayUi } from "../helper.ts"; import { PREF_DECLS } from "./decl.ts"; import { change_pref, PrefDecl, PREFS } from "./mod.ts"; @@ -21,7 +21,11 @@ export class PrefUi extends OverlayUi { } return espan(`(not implemented)`) }) - super(ediv({ class: "prefs-overlay" }, ...elements)) + 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() }), + ) + super(ediv({ class: "prefs-overlay" }, notification_perm, ebr(), ...elements)) } } -- cgit v1.2.3-70-g09d2