fix(autoUpdate): improve error handling and UI reset during update process

This commit is contained in:
MasterAcnolo
2026-09-29 17:20:42 +02:00
parent ac1d74ff23
commit 1937738ab8
3 changed files with 31 additions and 9 deletions

View File

@@ -122,10 +122,19 @@ contextBridge.exposeInMainWorld("electronAPI", {
*/
installUpdate: () => ipcRenderer.invoke("install-update"),
/**
* Subscribes to the update error event.
*
* @param {Function} callback - Function executed with error information when an update error occurs.
* @returns {Electron.IpcRenderer}
*/
onUpdateError: (callback) => ipcRenderer.on("update-error", (_, err) => callback(err)),
/**
* Subscribes to the download progress event.
*
* @param {Function} callback - Function executed with progress metrics (percent, bytesPerSecond, transferred, total).
* @returns {Electron.IpcRenderer}
*/
onDownloadProgress: (callback) =>
ipcRenderer.on("update-progress", (_, progress) => callback(progress)),