♻️ (notification)

This commit is contained in:
2020-07-12 22:52:37 +02:00
parent 6e0d7d2bbc
commit d9385bc457

View File

@@ -7,10 +7,9 @@ if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, { register(`${process.env.BASE_URL}service-worker.js`, {
ready(sw) { ready(sw) {
sw.getNotifications().then((notifs) => { sw.getNotifications().then((notifs) => {
const newVersions = notifs.filter( notifs
(notif) => notif.tag === 'new-version' .filter((notif) => notif.tag === 'new-version')
) .forEach((notif) => notif.close())
newVersions.forEach((notif) => notif.close())
}) })
console.log('App is being served from cache by a service worker') console.log('App is being served from cache by a service worker')
setNotificationInstance((title, options?) => setNotificationInstance((title, options?) =>