From 67ad38d0a7cd319623e9f41c0c381ed5c5f6f973 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Mon, 19 Jul 2021 18:32:55 +0200 Subject: added theme fetching --- web-build/register-service-worker.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'web-build/register-service-worker.js') 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); + }); + }); +} -- cgit v1.2.3