fix: wait for renderer ready before sending tab data

- Wait for did-finish-load event in transfer-tab-data handler
- Await transferTabData before closing file in handlePopOut
- Remove arbitrary 500ms timeout, now uses proper IPC ack flow
This commit is contained in:
2026-03-22 00:06:01 +08:00
parent d0e286e4bb
commit 2d87c267cf
2 changed files with 12 additions and 3 deletions

View File

@@ -135,9 +135,7 @@ export const NoteBrowser = () => {
const result = await window.electronAPI?.createWindow({ route, title: file.name })
if (result?.success && result.windowId) {
setTimeout(() => {
window.electronAPI?.transferTabData(result.windowId!, tabData)
}, 500)
await window.electronAPI?.transferTabData(result.windowId!, tabData)
}
closeFile(file)