Spaces:
Paused
Paused
Download src/shared/components/PwaRegister.tsx from igorkurgin/omniroute: direct link, hf CLI and curl.
- Browser
- Download file 368 Bytes
-
https://huggingface.co/spaces/igorkurgin/omniroute/resolve/main/src/shared/components/PwaRegister.tsx
- Command line
-
hf download hf://spaces/igorkurgin/omniroute/src/shared/components/PwaRegister.tsx
-
curl -L -o PwaRegister.tsx https://huggingface.co/spaces/igorkurgin/omniroute/resolve/main/src/shared/components/PwaRegister.tsx
368 Bytes
| "use client"; | |
| import { useEffect } from "react"; | |
| export function PwaRegister() { | |
| useEffect(() => { | |
| if (typeof window === "undefined" || !("serviceWorker" in navigator)) { | |
| return; | |
| } | |
| navigator.serviceWorker.register("/sw.js").catch(() => { | |
| // Ignore registration failures to avoid blocking app rendering. | |
| }); | |
| }, []); | |
| return null; | |
| } | |