diff options
author | Vitaly Takmazov | 2024-07-29 10:18:54 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-07-29 10:18:54 +0300 |
commit | f9b063ece0b321c4652533dd570065dc841b9a81 (patch) | |
tree | ad1759c73d760c93bcc43b83ca2806abe668ece5 /src | |
parent | 4fc0b2baec174e8ccb98f88a16d012668845e49e (diff) |
Bundle service worker correctly
Diffstat (limited to 'src')
-rw-r--r-- | src/main/assets/scripts.js | 2 | ||||
-rw-r--r-- | src/main/assets/sw.js (renamed from src/main/resources/static/sw.js) | 0 |
2 files changed, 1 insertions, 1 deletions
diff --git a/src/main/assets/scripts.js b/src/main/assets/scripts.js index 38406c2a..1583cedc 100644 --- a/src/main/assets/scripts.js +++ b/src/main/assets/scripts.js @@ -535,7 +535,7 @@ function fetchUserUri(dataUri) { const registerServiceWorker = () => { const publicKey = 'BPU0LniKKR0QiaUvILPd9AystmSOU8rWDZobxKm7IJN5HYxOSQdktRdc74TZvyRS9_kyUz7LDN6gUAmAVOmObAU' - navigator.serviceWorker.register('/sw.js', { scope: '/' }) + navigator.serviceWorker.register(new URL('./sw.js', import.meta.url), { scope: '/' }) navigator.serviceWorker.ready.then(reg => { return reg.pushManager.subscribe({ userVisibleOnly: true, diff --git a/src/main/resources/static/sw.js b/src/main/assets/sw.js index a64de7cc..a64de7cc 100644 --- a/src/main/resources/static/sw.js +++ b/src/main/assets/sw.js |