From 936d19cd60eff95e4b4e969e5893e4abe9395d35 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:03:39 +1100 Subject: [PATCH] feat(ui): improve comments on socketConnected listener --- .../listeners/socketio/socketConnected.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts index 134e4466eb..851e3251b3 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected.ts @@ -24,11 +24,13 @@ export const addSocketConnectedEventListener = () => { /** * The rest of this listener has recovery logic for when the socket disconnects and reconnects. - * If we had generations in progress, we need to reset the API state to re-fetch everything. + * + * If a queue item completed during while disconnected, we need to reset the API state to re- + * fetch everything, updating the gallery and queue. */ if ($isFirstConnection.get()) { - // Bail on the recovery logic if this is the first connection + // Bail on the recovery logic if this is the first connection - we don't need to recover anything $isFirstConnection.set(false); return; } @@ -93,6 +95,7 @@ export const addSocketConnectedEventListener = () => { actionCreator: socketConnected, effect: async (action, { dispatch, getState }) => { const { nodeTemplates, config } = getState(); + // We only want to re-fetch the schema if we don't have any node templates if ( !size(nodeTemplates.templates) && !config.disabledTabs.includes('nodes')