mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-11-13 15:09:20 +01:00
fix(autoUpdate): improve error handling and UI reset during update process
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user