From 3297a8837211ad8678d4db27c331dc54888247ba Mon Sep 17 00:00:00 2001 From: Abel <59095867+BlessedOneKobo@users.noreply.github.com> Date: Sun, 17 Sep 2023 22:46:56 +0100 Subject: [PATCH] Update periodic-sw-updates.md example code Simplify boolean condition --- guide/periodic-sw-updates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/periodic-sw-updates.md b/guide/periodic-sw-updates.md index b33f948..c206510 100644 --- a/guide/periodic-sw-updates.md +++ b/guide/periodic-sw-updates.md @@ -49,7 +49,7 @@ const intervalMS = 60 * 60 * 1000 const updateSW = registerSW({ onRegisteredSW(swUrl, r) { r && setInterval(async () => { - if (!(!r.installing && navigator)) + if (r.installing || !navigator) return if (('connection' in navigator) && !navigator.onLine)