mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-04 02:01:48 +03:00
feat(webui): add PWA support for mobile home screen installation
- Add manifest.json with icons for install prompt - Add service worker with cache-first for static assets - Register SW in main.tsx - Link manifest in index.html
This commit is contained in:
@@ -28,3 +28,11 @@ initializeLoopbackRuntimeHost();
|
||||
|
||||
/* StrictMode disabled: dev double-invokes state updaters; delta accumulation must stay pure — see useNanobotStream. */
|
||||
ReactDOM.createRoot(root).render(<App />);
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
window.addEventListener("load", () => {
|
||||
navigator.serviceWorker.register("/sw.js", {
|
||||
updateViaCache: "none",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user