On button click I successfully register for sync
and it fires the functionality I've described in the service-worker
.
If I'm offline - it waits for the browser to get connection and then it fires.
BUT - when I click the button the first time and all is fine - from then on clicking the button again successfully registers for sync
, but the sync
event in the service-worker never triggers:
self.addEventListener('sync', function(event) {
console.log('EVENT in SYNC', event);
}
I see the console logging only the first time I click the button. Am I missing something?