mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-08 01:06:41 +08:00
fix service-worker
This commit is contained in:
@@ -33,6 +33,7 @@ self.addEventListener('push', function (event) {
|
||||
}
|
||||
}
|
||||
// 根据推送消息生成桌面通知并展现出来
|
||||
try {
|
||||
let promise = self.registration.showNotification(payload.title, {
|
||||
body: payload.body,
|
||||
icon: payload.icon ?? options.icon,
|
||||
@@ -41,6 +42,9 @@ self.addEventListener('push', function (event) {
|
||||
},
|
||||
})
|
||||
event.waitUntil(promise)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
})
|
||||
|
||||
self.skipWaiting()
|
||||
|
||||
Reference in New Issue
Block a user