♻️ (notification)
This commit is contained in:
@@ -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?) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user