From 33278214fd55a76032d01038c52c52adc8fab744 Mon Sep 17 00:00:00 2001 From: 230419 <230419@epvc.pt> Date: Thu, 21 May 2026 10:11:10 +0100 Subject: [PATCH] aaa --- index.html | 1 + public/manifest.json | 15 +++++++++++++++ public/sw.js | 1 + src/main.jsx | 8 ++++++++ 4 files changed, 25 insertions(+) create mode 100644 public/manifest.json create mode 100644 public/sw.js diff --git a/index.html b/index.html index 3c7e141..b17a305 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ MyCloset +
diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..026a67e --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,15 @@ +{ + "name": "MyCloset", + "short_name": "MyCloset", + "start_url": "/", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#4F46E5", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ] +} diff --git a/public/sw.js b/public/sw.js new file mode 100644 index 0000000..e4301e9 --- /dev/null +++ b/public/sw.js @@ -0,0 +1 @@ +self.addEventListener('fetch', function(event) {}); diff --git a/src/main.jsx b/src/main.jsx index b4296e8..ee5e78f 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -3,6 +3,14 @@ import ReactDOM from 'react-dom/client' import App from './App.jsx' import './index.css' +if ('serviceWorker' in navigator) { + window.addEventListener('load', () => { + navigator.serviceWorker.register('/sw.js').catch(err => { + console.error('Service worker registration failed', err); + }); + }); +} + ReactDOM.createRoot(document.getElementById('root')).render(