diff options
author | Mario <mario@mariovavti.com> | 2021-06-24 08:15:44 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-06-24 08:15:44 +0000 |
commit | 088713a5557d86957870625a7fdc0d236c833374 (patch) | |
tree | 111842f561778cff9706f3280f43e34674761499 /view/tpl/chat.tpl | |
parent | 7582ebc9c8dd590b42ae9e51596ba6db47a26239 (diff) | |
download | volse-hubzilla-088713a5557d86957870625a7fdc0d236c833374.tar.gz volse-hubzilla-088713a5557d86957870625a7fdc0d236c833374.tar.bz2 volse-hubzilla-088713a5557d86957870625a7fdc0d236c833374.zip |
Notification.requestPermission() only fires if wraped in click handler
Diffstat (limited to 'view/tpl/chat.tpl')
-rw-r--r-- | view/tpl/chat.tpl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index 7ef957b7e..2f224b3cf 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -110,7 +110,9 @@ $(document).ready(function() { $('#chatroom_bookmarks, #vcard').hide(); $('#chatroom_list, #chatroom_members').show(); adjustInlineTopBarHeight(); - chatNotificationInit(); + $('#toggle-notifications').one('click', function() { + chatNotificationInit(); + }); }); $(window).resize(function () { @@ -141,7 +143,7 @@ function load_chats() { $('#chat-top-spinner').hide(); } }); - + chat_timer = setTimeout(load_chats,10000); } @@ -218,7 +220,7 @@ var chat_notify_audio = {}; // Request notification access from the user // TODO: Check Hubzilla member config setting before requesting permission function chatNotificationInit() { - + if (!("Notification" in window)) { window.console.log("This browser does not support system notifications"); } @@ -258,8 +260,8 @@ var chat_issue_notification = function (theBody,theTitle) { } var n = new Notification(theTitle,options); n.onclick = function (event) { - setTimeout(n.close.bind(n), 300); - } + setTimeout(n.close.bind(n), 300); + } if(chat_notify_audio_enabled) { chat_notify_audio.play(); } |