demos for spacedust

get service worker from main script

..... i expected this to be more complicated. wow.

+3 -1
atproto-notifications/public/service-worker.js atproto-notifications/src/service-worker.ts
+3 -1
atproto-notifications/src/App.tsx
··· 35 35 } 36 36 37 37 async function subscribeToPush() { 38 - const registration = await navigator.serviceWorker.register('/service-worker.js'); 38 + const worker_url = new URL('service-worker.ts', import.meta.url); 39 + const registration = await navigator.serviceWorker.register(worker_url); 40 + 39 41 const subscribeOptions = { 40 42 userVisibleOnly: true, 41 43 applicationServerKey: urlBase64ToUint8Array(import.meta.env.VITE_PUSH_PUBKEY),