2026-08-12 19:08:14 +00:00
|
|
|
|
import { createRoot, type Root } from 'react-dom/client'
|
|
|
|
|
|
import AppUpdateDialog from './AppUpdateDialog'
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Güncelleme penceresi uygulama ağacından bağımsız, kendi kökünde mount edilir:
|
|
|
|
|
|
* - Entry chunk'ta taşınmaz (yalnızca güncelleme varken indirilir).
|
|
|
|
|
|
* - Router/Store yeniden render'larından etkilenmez, güncelleme sırasında
|
|
|
|
|
|
* uygulama yeniden yüklense bile pencere ayakta kalır.
|
|
|
|
|
|
*/
|
|
|
|
|
|
let root: Root | undefined
|
|
|
|
|
|
|
2026-08-12 21:52:49 +00:00
|
|
|
|
export const mountAppUpdateDialog = () => {
|
2026-08-12 19:08:14 +00:00
|
|
|
|
if (root) return
|
|
|
|
|
|
const host = document.createElement('div')
|
|
|
|
|
|
host.id = 'app-update-root'
|
|
|
|
|
|
document.body.appendChild(host)
|
|
|
|
|
|
root = createRoot(host)
|
|
|
|
|
|
root.render(<AppUpdateDialog />)
|
|
|
|
|
|
}
|