diff options
Diffstat (limited to 'web-build/register-service-worker.js')
-rw-r--r-- | web-build/register-service-worker.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/web-build/register-service-worker.js b/web-build/register-service-worker.js index ea5cca4..94ece4f 100644 --- a/web-build/register-service-worker.js +++ b/web-build/register-service-worker.js @@ -1 +1,14 @@ -"serviceWorker"in navigator&&window.addEventListener("load",(function(){navigator.serviceWorker.register("/expo-service-worker.js",{scope:"/"}).then((function(e){})).catch((function(e){console.info("Failed to register service-worker",e)}))}));
\ No newline at end of file +/* eslint-env browser */ + +if ('serviceWorker' in navigator) { + window.addEventListener('load', function () { + navigator.serviceWorker + .register('/expo-service-worker.js', { scope: '/' }) + .then(function (info) { + // console.info('Registered service-worker', info); + }) + .catch(function (error) { + console.info('Failed to register service-worker', error); + }); + }); +} |