mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 22:57:40 +03:00
Improve updating of notification script
This commit is contained in:
parent
3fd7859684
commit
4496eb0021
@ -126,6 +126,8 @@ export default function NotificationsSettingsExtras({
|
|||||||
.getRegistration(NOTIFICATION_SERVICE_WORKER)
|
.getRegistration(NOTIFICATION_SERVICE_WORKER)
|
||||||
.then((worker) => {
|
.then((worker) => {
|
||||||
if (worker) {
|
if (worker) {
|
||||||
|
// Trigger a check for an updated service worker script
|
||||||
|
worker.update().catch(() => {});
|
||||||
setRegistration(worker);
|
setRegistration(worker);
|
||||||
} else {
|
} else {
|
||||||
setRegistration(null);
|
setRegistration(null);
|
||||||
@ -633,7 +635,9 @@ export default function NotificationsSettingsExtras({
|
|||||||
Notification.requestPermission().then((permission) => {
|
Notification.requestPermission().then((permission) => {
|
||||||
if (permission === "granted") {
|
if (permission === "granted") {
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
.register(NOTIFICATION_SERVICE_WORKER)
|
.register(NOTIFICATION_SERVICE_WORKER, {
|
||||||
|
updateViaCache: "none",
|
||||||
|
})
|
||||||
.then((workerRegistration) => {
|
.then((workerRegistration) => {
|
||||||
setRegistration(workerRegistration);
|
setRegistration(workerRegistration);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user