client: ensure a proper init order for server-client communication

This commit is contained in:
jean-emmanuel 2025-12-04 17:56:12 +01:00
parent dc7ac2bcd3
commit acf5f74ea2
3 changed files with 32 additions and 23 deletions

View file

@ -13,18 +13,20 @@ function init() {
setTimeout(()=>{
ipc.init()
ipc.init(()=>{
document.title = TITLE
ipc.send('open', {hotReload: backup.exists})
document.title = TITLE
window.onunload = ()=>{
ipc.send('close')
}
ipc.send('open', {hotReload: backup.exists})
backup.load()
window.onunload = ()=>{
ipc.send('close')
}
backup.load()
})
}, 100)