Skip to content

Commit

Permalink
refactor: remove code for manual service worker registration
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Feb 26, 2024
1 parent 571535a commit 78173a4
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,21 @@ ReactDOM.render(
document.getElementById('app'),
);

// Register service worker
if (import.meta.env.MODE === 'production') {
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/service-worker.js')
.then((registration) => {
console.log('ServiceWorker registered: ', registration);
})
.catch((error) => {
console.log('ServiceWorker registration failed: ', error);
});
});
}
}
// // Register service worker manually
// if (import.meta.env.MODE === 'production') {
// if ('serviceWorker' in navigator) {
// window.addEventListener('load', () => {
// navigator.serviceWorker
// .register('/service-worker.js')
// .then((registration) => {
// console.log('ServiceWorker registered: ', registration);
// })
// .catch((error) => {
// console.log('ServiceWorker registration failed: ', error);
// });
// });
// }
// }
// if (import.meta.env.MODE === 'development') {
// navigator.serviceWorker.getRegistrations().then(function (registrations) {
// for (let registration of registrations) {
Expand Down

0 comments on commit 78173a4

Please sign in to comment.