Skip to content

Commit 8d33933

Browse files
authored
fix: Correct parameter handling in registerPeriodicSync function (#23)
- Corrected the parameter order in the `registerPeriodicSync` function calls. - Ensured proper handling of Service Worker state changes and event listeners. This update ensures that the periodic sync registration is set up correctly.
1 parent 2b9325e commit 8d33933

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/template-vue/src/components/PWABadge.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ const { offlineReady, needRefresh, updateServiceWorker } = useRegisterSW({
3939
if (period <= 0) return
4040
if (r?.active?.state === 'activated') {
4141
swActivated.value = true
42-
registerPeriodicSync(period, swUrl, r)
42+
registerPeriodicSync(swUrl, r)
4343
}
4444
else if (r?.installing) {
4545
r.installing.addEventListener('statechange', (e) => {
4646
/** @type {ServiceWorker} */
4747
const sw = e.target
4848
swActivated.value = sw.state === 'activated'
4949
if (swActivated.value)
50-
registerPeriodicSync(period, swUrl, r)
50+
registerPeriodicSync(swUrl, r)
5151
})
5252
}
5353
},

0 commit comments

Comments
 (0)