fix(pwa) remove window.load event handler for pwa registrator

This commit is contained in:
Tudor-Ovidiu Avram 2020-10-16 12:04:53 +03:00 committed by Saúl Ibarra Corretgé
parent ab5c8d49c3
commit d854b2cd3d
1 changed files with 8 additions and 10 deletions

View File

@ -1,12 +1,10 @@
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
window.addEventListener('load', () => { navigator.serviceWorker
navigator.serviceWorker .register('pwa-worker.js')
.register('pwa-worker.js') .then(reg => {
.then(reg => { console.log('Service worker registered.', reg);
console.log('Service worker registered.', reg); })
}) .catch(err => {
.catch(err => { console.log(err);
console.log(err); });
});
});
} }