Make maintenance installable as a PWA
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
83ac37e4a1
commit
ced0754fcc
7 changed files with 4423 additions and 3 deletions
|
|
@ -3,6 +3,14 @@ import ReactDOM from 'react-dom/client'
|
|||
import App from './App'
|
||||
import './index.css'
|
||||
|
||||
|
||||
if (new URLSearchParams(window.location.search).has('install')) {
|
||||
window.addEventListener('beforeinstallprompt', e => {
|
||||
e.preventDefault()
|
||||
;(e as Event & { prompt: () => Promise<void> }).prompt()
|
||||
}, { once: true })
|
||||
}
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue