Update service worker
parent
593938c36d
commit
32c7ee5805
|
@ -30,7 +30,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator && import.meta.env.PROD) {
|
||||||
broadcastChannel = new BroadcastChannel('paimonmoe-sw');
|
broadcastChannel = new BroadcastChannel('paimonmoe-sw');
|
||||||
broadcastChannel.addEventListener('message', (event) => {
|
broadcastChannel.addEventListener('message', (event) => {
|
||||||
if (event.data.type === 'update') refreshUpdate();
|
if (event.data.type === 'update') refreshUpdate();
|
||||||
|
|
Loading…
Reference in New Issue