diff options
author | XhmikosR <xhmikosr@gmail.com> | 2017-12-05 14:21:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-05 14:21:16 +0300 |
commit | af34799eda8d0ed92462cf277610a57e8610be88 (patch) | |
tree | d569de911112372192cfeed19183e7db1027b929 /assets/js | |
parent | 3a0f8d73df138fd3aff83b8d1a1639e30ff889c9 (diff) |
Remove page reload in pwa.js. (#24923)
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/src/pwa.js | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/assets/js/src/pwa.js b/assets/js/src/pwa.js index 5e1a43b085..3484f05b04 100644 --- a/assets/js/src/pwa.js +++ b/assets/js/src/pwa.js @@ -7,24 +7,11 @@ window.addEventListener('load', function () { navigator.serviceWorker.register('/sw.js').then(function (registration) { // eslint-disable-line compat/compat console.log('ServiceWorker registration successful with scope: ', registration.scope) - registration.onupdatefound = function () { - var installingWorker = registration.installing - installingWorker.onstatechange = function () { - switch (installingWorker.state) { - case 'installed': - if (navigator.serviceWorker.controller) { // eslint-disable-line compat/compat - console.log('new update available') - location.reload(true) - } - break - - default: - } - } - } }).catch(function (err) { console.log('ServiceWorker registration failed: ', err) }) }) + } else { + console.log('Service workers are not supported.') } }()) |