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