summaryrefslogtreecommitdiff
path: root/client-web/source/helper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client-web/source/helper.ts')
-rw-r--r--client-web/source/helper.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/client-web/source/helper.ts b/client-web/source/helper.ts
index 35be473..4075a0f 100644
--- a/client-web/source/helper.ts
+++ b/client-web/source/helper.ts
@@ -64,3 +64,12 @@ export function image_view(url: string, opts?: Opts): HTMLElement {
})
return img
}
+
+export function notify(body: string, author?: string) {
+ if (document.hasFocus()) return
+ if (Notification.permission != "granted") return
+ if (author)
+ new Notification(`keks-meet: ${author}`, { body })
+ else
+ new Notification(`keks-meet`, { body })
+}