diff --git a/src/index.tsx b/src/index.tsx index b11ec6e..d6498a8 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -10,7 +10,7 @@ import '../src/font/font.css' const rootElement = document.getElementById('root') -if (rootElement) { +if (rootElement && 'serviceWorker' in navigator) { const root = createRoot(rootElement) root.render( @@ -20,9 +20,7 @@ if (rootElement) { ) - if ('serviceWorker' in navigator) { - navigator.serviceWorker.register("/sw.js") - } + navigator.serviceWorker.register("/sw.js") } else { console.log (`CoNET Platform Loader Error: can't find rootElement`)