Skip to content

Commit a24d46a

Browse files
committed
added public redirect file to fix reloading error
1 parent 0a7565c commit a24d46a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

public/_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* /index.html 200

src/main.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,17 @@ Promise.all([import('@/Root'), import('@/App')]).then(([{ default: render }, { d
1010
render(App);
1111
});
1212

13+
// Register the service worker
14+
if ('serviceWorker' in navigator) {
15+
window.addEventListener('load', () => {
16+
navigator.serviceWorker.register('/registerSW.js')
17+
.then(registration => {
18+
console.log('ServiceWorker registration successful with scope: ', registration.scope);
19+
})
20+
.catch(error => {
21+
console.log('ServiceWorker registration failed: ', error);
22+
});
23+
});
24+
}
25+
1326
export {};

0 commit comments

Comments
 (0)