diff --git a/src/main.jsx b/src/main.jsx index 3054f84..9a4901c 100755 --- a/src/main.jsx +++ b/src/main.jsx @@ -44,8 +44,16 @@ const Main = () => { } } }; + + registerServiceWorker(); + useEffect(() => { - registerServiceWorker(); + if ("serviceWorker" in navigator && navigator.serviceWorker.controller) { + navigator.serviceWorker.controller.postMessage({ + type: "TOKEN", + token: token, + }); + } }, [token]); return <>; };