From b2182821495e8cb20c0480f65f8dc453b9fc1c91 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:52:06 +1100 Subject: [PATCH] fix(ui): model install progress sets total bytes correctly --- .../listeners/socketio/socketModelInstall.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketModelInstall.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketModelInstall.ts index b658354c42..60dc173cb4 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketModelInstall.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketModelInstall.ts @@ -12,13 +12,14 @@ export const addModelInstallEventListener = () => { startAppListening({ actionCreator: socketModelInstallDownloading, effect: async (action, { dispatch }) => { - const { bytes, id } = action.payload.data; + const { bytes, total_bytes, id } = action.payload.data; dispatch( modelsApi.util.updateQueryData('getModelImports', undefined, (draft) => { const modelImport = draft.find((m) => m.id === id); if (modelImport) { modelImport.bytes = bytes; + modelImport.total_bytes = total_bytes; modelImport.status = 'downloading'; } return draft; @@ -48,7 +49,7 @@ export const addModelInstallEventListener = () => { startAppListening({ actionCreator: socketModelInstallError, effect: (action, { dispatch }) => { - const { id, error_type } = action.payload.data; + const { id, error, error_type } = action.payload.data; dispatch( modelsApi.util.updateQueryData('getModelImports', undefined, (draft) => { @@ -56,6 +57,7 @@ export const addModelInstallEventListener = () => { if (modelImport) { modelImport.status = 'error'; modelImport.error_reason = error_type; + modelImport.error = error; } return draft; })