fixing notifications if service Worker is not registered

This commit is contained in:
2019-03-31 15:55:54 +02:00
committed by GitHub
parent 4f9f0ed9a9
commit e262eb5b79

View File

@ -539,6 +539,12 @@ class WebsocketConnection
Notification.requestPermission(function(result) {
if (result === 'granted') {
if (navigator.serviceWorker == undefined)
{
var notification = new Notification(text);
return;
}
navigator.serviceWorker.ready.then(function(registration) {
registration.showNotification(text, {
icon: './icon.png',