Skip to content

Commit

Permalink
Update periodic-sw-updates.md example code
Browse files Browse the repository at this point in the history
Simplify boolean condition
  • Loading branch information
BlessedOneKobo committed Sep 17, 2023
1 parent 82146e1 commit 3297a88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guide/periodic-sw-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3297a88

Please sign in to comment.