fix for warning when serviceWorker is present without getNotifications
This commit is contained in:
parent
ada365b76f
commit
4e72bd4258
|
|
@ -631,11 +631,15 @@ $(function (){
|
|||
function closeNotifications(){
|
||||
try {
|
||||
navigator.serviceWorker.ready.then(function(registration){
|
||||
registration.getNotifications({tag: 'notice'}).then(function(notifications){
|
||||
for (const notification of notifications) {
|
||||
notification.close();
|
||||
try {
|
||||
if ('getNotifications' in registration) {
|
||||
registration.getNotifications({tag: 'notice'}).then(function(notifications){
|
||||
for (const notification of notifications) {
|
||||
notification.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (err) {}
|
||||
});
|
||||
} catch (err) {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue