Spaces:
Sleeping
Sleeping
Download frontend/src/main.jsx from jinksQspider/SSC: direct link, hf CLI and curl.
- Browser
- Download file 881 Bytes
-
https://huggingface.co/spaces/jinksQspider/SSC/resolve/main/frontend/src/main.jsx
- Command line
-
hf download hf://spaces/jinksQspider/SSC/frontend/src/main.jsx
-
curl -L -o main.jsx https://huggingface.co/spaces/jinksQspider/SSC/resolve/main/frontend/src/main.jsx
881 Bytes
| import React from 'react' | |
| import ReactDOM from 'react-dom/client' | |
| import App from './App.jsx' | |
| import './styles/global.css' | |
| ReactDOM.createRoot(document.getElementById('root')).render( | |
| <React.StrictMode> | |
| <App /> | |
| </React.StrictMode>, | |
| ) | |
| // Register Service Worker for PWA | |
| if ('serviceWorker' in navigator) { | |
| if (import.meta.env.DEV) { | |
| navigator.serviceWorker.getRegistrations().then((registrations) => { | |
| registrations.forEach((registration) => { | |
| registration.unregister(); | |
| }); | |
| }); | |
| } else { | |
| window.addEventListener('load', () => { | |
| navigator.serviceWorker.register('/service-worker.js') | |
| .then((registration) => { | |
| console.log('[PWA] Service Worker registered:', registration); | |
| }) | |
| .catch((error) => { | |
| console.log('[PWA] Service Worker registration failed:', error); | |
| }); | |
| }); | |
| } | |
| } | |