From 98518a60ab66b980fed3780c98d9f0fc12653f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Thu, 29 Feb 2024 12:32:21 +0100 Subject: [PATCH] fix: wrong changes reverting prompt logic (#675) --- src/client/build/register.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/build/register.ts b/src/client/build/register.ts index 3bc2570a..2fad68b7 100644 --- a/src/client/build/register.ts +++ b/src/client/build/register.ts @@ -62,7 +62,7 @@ export function registerSW(options: RegisterSWOptions = {}) { window.location.reload() }) wb.addEventListener('installed', (event) => { - if (event.isUpdate === false) { + if (!event.isUpdate) { onOfflineReady?.() } }); @@ -83,7 +83,7 @@ export function registerSW(options: RegisterSWOptions = {}) { // that will reload the page as soon as the previously waiting // service worker has taken control. wb?.addEventListener('controlling', (event) => { - if (!event.isUpdate) + if (event.isUpdate) window.location.reload() })