diff options
author | metamuffin <metamuffin@disroot.org> | 2022-09-10 18:34:37 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-09-10 18:34:37 +0200 |
commit | 0fe8df550d95926aca1607e6f9ef7ac8cb929adf (patch) | |
tree | 6a9b9da6f246d003688ab68ba1064fd779013063 /client-web/source/helper.ts | |
parent | f268bd2087fbfb57b8504becf364a00ddebde075 (diff) | |
download | keks-meet-0fe8df550d95926aca1607e6f9ef7ac8cb929adf.tar keks-meet-0fe8df550d95926aca1607e6f9ef7ac8cb929adf.tar.bz2 keks-meet-0fe8df550d95926aca1607e6f9ef7ac8cb929adf.tar.zst |
notifications
Diffstat (limited to 'client-web/source/helper.ts')
-rw-r--r-- | client-web/source/helper.ts | 9 |
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 }) +} |