fix: capture terminal buffers before quitAndInstall (#241)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
12dc676209
commit
12344a51cf
@@ -204,7 +204,13 @@ const api = {
|
||||
getVersion: (): Promise<string> => ipcRenderer.invoke('updater:getVersion'),
|
||||
check: (): Promise<void> => ipcRenderer.invoke('updater:check'),
|
||||
download: (): Promise<void> => ipcRenderer.invoke('updater:download'),
|
||||
quitAndInstall: (): Promise<void> => ipcRenderer.invoke('updater:quitAndInstall'),
|
||||
quitAndInstall: (): Promise<void> => {
|
||||
// Dispatch beforeunload to trigger terminal buffer capture before the
|
||||
// update process bypasses the normal window close sequence (quitAndInstall
|
||||
// removes close listeners, preventing beforeunload from firing naturally).
|
||||
window.dispatchEvent(new Event('beforeunload'))
|
||||
return ipcRenderer.invoke('updater:quitAndInstall')
|
||||
},
|
||||
onStatus: (callback: (status: unknown) => void): (() => void) => {
|
||||
const listener = (_event: Electron.IpcRendererEvent, status: unknown) => callback(status)
|
||||
ipcRenderer.on('updater:status', listener)
|
||||
|
||||
Reference in New Issue
Block a user