From bfd1a76a2d8d8c05fc8253237b48242514e31c43 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 27 Apr 2024 20:37:23 +0200 Subject: [PATCH] Notifications use the PNG logo Signed-off-by: Emmy D'Anello --- chat/static/chat.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chat/static/chat.js b/chat/static/chat.js index 482d8b1..c00c369 100644 --- a/chat/static/chat.js +++ b/chat/static/chat.js @@ -18,10 +18,10 @@ let selected_channel_id = null * @return Notification */ function showNotification(title, body, timeout = 5000) { - let notif = new Notification(title, {'body': body, 'icon': "/static/tfjm.svg"}) - if (timeout) - setTimeout(() => notif.close(), timeout) - return notif + Notification.requestPermission().then((status) => { + if (status === 'granted') + new Notification(title, {'body': body, 'icon': "/static/tfjm-192.png"}) + }) } function selectChannel(channel_id) {