mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix canvas auto-save not working
This commit is contained in:
parent
fc5f9c30a6
commit
40d6e4f287
@ -1,6 +1,6 @@
|
|||||||
import { log } from 'app/logging/useLogger';
|
import { log } from 'app/logging/useLogger';
|
||||||
import { startAppListening } from '..';
|
import { startAppListening } from '..';
|
||||||
import { imageMetadataReceived } from 'services/thunks/image';
|
import { imageMetadataReceived, imageUpdated } from 'services/thunks/image';
|
||||||
import { imageUpserted } from 'features/gallery/store/imagesSlice';
|
import { imageUpserted } from 'features/gallery/store/imagesSlice';
|
||||||
|
|
||||||
const moduleLog = log.child({ namespace: 'image' });
|
const moduleLog = log.child({ namespace: 'image' });
|
||||||
@ -10,10 +10,25 @@ export const addImageMetadataReceivedFulfilledListener = () => {
|
|||||||
actionCreator: imageMetadataReceived.fulfilled,
|
actionCreator: imageMetadataReceived.fulfilled,
|
||||||
effect: (action, { getState, dispatch }) => {
|
effect: (action, { getState, dispatch }) => {
|
||||||
const image = action.payload;
|
const image = action.payload;
|
||||||
if (image.is_intermediate) {
|
|
||||||
|
const state = getState();
|
||||||
|
|
||||||
|
if (
|
||||||
|
image.session_id === state.canvas.layerState.stagingArea.sessionId &&
|
||||||
|
state.canvas.shouldAutoSave
|
||||||
|
) {
|
||||||
|
dispatch(
|
||||||
|
imageUpdated({
|
||||||
|
imageName: image.image_name,
|
||||||
|
imageOrigin: image.image_origin,
|
||||||
|
requestBody: { is_intermediate: false },
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else if (image.is_intermediate) {
|
||||||
// No further actions needed for intermediate images
|
// No further actions needed for intermediate images
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
moduleLog.debug({ data: { image } }, 'Image metadata received');
|
moduleLog.debug({ data: { image } }, 'Image metadata received');
|
||||||
dispatch(imageUpserted(image));
|
dispatch(imageUpserted(image));
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user