mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): unset progress image inside invocationComplete listener
This commit is contained in:
parent
82a8972bde
commit
57a3eb3652
@ -28,7 +28,6 @@ import { addSocketDisconnectedListener } from './listeners/socketio/socketDiscon
|
||||
import { addSocketSubscribedListener } from './listeners/socketio/socketSubscribed';
|
||||
import { addSocketUnsubscribedListener } from './listeners/socketio/socketUnsubscribed';
|
||||
import { addSessionReadyToInvokeListener } from './listeners/sessionReadyToInvoke';
|
||||
import { addImageMetadataReceivedListener } from './listeners/imageMetadataReceived';
|
||||
|
||||
export const listenerMiddleware = createListenerMiddleware();
|
||||
|
||||
@ -51,7 +50,6 @@ export type AppListenerEffect = ListenerEffect<
|
||||
addImageUploadedListener();
|
||||
addInitialImageSelectedListener();
|
||||
addRequestedImageDeletionListener();
|
||||
addImageMetadataReceivedListener();
|
||||
|
||||
addUserInvokedCanvasListener();
|
||||
addUserInvokedNodesListener();
|
||||
|
@ -1,26 +0,0 @@
|
||||
import { invocationComplete } from 'services/events/actions';
|
||||
import { isImageOutput } from 'services/types/guards';
|
||||
import { imageMetadataReceived } from 'services/thunks/image';
|
||||
import { startAppListening } from '..';
|
||||
import { progressImageSet } from '../../../../../features/system/store/systemSlice';
|
||||
|
||||
export const addImageMetadataReceivedListener = () => {
|
||||
startAppListening({
|
||||
predicate: (action) => {
|
||||
if (
|
||||
invocationComplete.match(action) &&
|
||||
isImageOutput(action.payload.data.result)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
effect: async (action, { getState, dispatch, take }) => {
|
||||
if (imageMetadataReceived.fulfilled.match(action)) {
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(progressImageSet(null));
|
||||
},
|
||||
});
|
||||
};
|
@ -8,6 +8,7 @@ import {
|
||||
} from 'services/thunks/image';
|
||||
import { sessionCanceled } from 'services/thunks/session';
|
||||
import { isImageOutput } from 'services/types/guards';
|
||||
import { progressImageSet } from 'features/system/store/systemSlice';
|
||||
|
||||
const moduleLog = log.child({ namespace: 'socketio' });
|
||||
const nodeDenylist = ['dataURL_image'];
|
||||
@ -37,12 +38,6 @@ export const addInvocationCompleteListener = () => {
|
||||
if (isImageOutput(result) && !nodeDenylist.includes(node.type)) {
|
||||
const { image_name, image_type } = result.image;
|
||||
|
||||
// Get its URLS
|
||||
// TODO: is this extraneous? I think so...
|
||||
dispatch(
|
||||
imageUrlsReceived({ imageName: image_name, imageType: image_type })
|
||||
);
|
||||
|
||||
// Get its metadata
|
||||
dispatch(
|
||||
imageMetadataReceived({
|
||||
@ -65,6 +60,8 @@ export const addInvocationCompleteListener = () => {
|
||||
);
|
||||
dispatch(addImageToStagingArea(image));
|
||||
}
|
||||
|
||||
dispatch(progressImageSet(null));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user