request notification permission on click

fix-notification-permission
Thibault Duplessis 2020-08-25 10:40:16 +02:00
parent 959eada2dc
commit 6bdd7cc93e
1 changed files with 1 additions and 2 deletions

View File

@ -293,8 +293,6 @@
const $toggle = $('#notify-toggle'),
isVisible = () => $('#notify-app').is(':visible');
if ('Notification' in window) Notification.requestPermission();
const load = function(data, incoming) {
if (booted) return;
booted = true;
@ -322,6 +320,7 @@
};
$toggle.one('mouseover click', () => load()).click(() => {
if ('Notification' in window) Notification.requestPermission();
setTimeout(() => {
if (instance && isVisible()) instance.setVisible();
}, 200);