Skip to content

Commit

Permalink
fix: DownloadManager onDownloadProgress callback type
Browse files Browse the repository at this point in the history
  • Loading branch information
otociulis committed Nov 19, 2024
1 parent 42837e4 commit 56e958e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ export interface SystemPaths {
defaultInstallPath: string;
}

export interface DownloadProgressUpdate {
url: string;
filename: string;
savePath: string;
progress: number;
status: DownloadStatus;
message?: string;
}

const electronAPI = {
/**
* Callback for progress updates from the main process for starting ComfyUI.
Expand Down Expand Up @@ -93,12 +102,7 @@ const electronAPI = {
},
DownloadManager: {
onDownloadProgress: (
callback: (progress: {
url: string;
progress_percentage: number;
status: DownloadStatus;
message?: string;
}) => void
callback: (progress: DownloadProgressUpdate) => void
) => {
ipcRenderer.on(IPC_CHANNELS.DOWNLOAD_PROGRESS, (_event, progress) => callback(progress));
},
Expand Down

0 comments on commit 56e958e

Please sign in to comment.