diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeletionListeners.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeletionListeners.ts index 9278cf94b6..4c9a045d60 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeletionListeners.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageDeletionListeners.ts @@ -40,8 +40,8 @@ const deleteNodesImages = (state: RootState, dispatch: AppDispatch, imageDTO: Im }; const deleteControlAdapterImages = (state: RootState, dispatch: AppDispatch, imageDTO: ImageDTO) => { - state.canvasV2.controlAdapters.forEach(({ id, image, processedImage }) => { - if (image?.name === imageDTO.image_name || processedImage?.name === imageDTO.image_name) { + state.canvasV2.controlAdapters.entities.forEach(({ id, imageObject, processedImageObject }) => { + if (imageObject?.image.name === imageDTO.image_name || processedImageObject?.image.name === imageDTO.image_name) { dispatch(caImageChanged({ id, imageDTO: null })); dispatch(caProcessedImageChanged({ id, imageDTO: null })); } @@ -49,15 +49,15 @@ const deleteControlAdapterImages = (state: RootState, dispatch: AppDispatch, ima }; const deleteIPAdapterImages = (state: RootState, dispatch: AppDispatch, imageDTO: ImageDTO) => { - state.canvasV2.ipAdapters.forEach(({ id, imageObject: image }) => { - if (image?.name === imageDTO.image_name) { + state.canvasV2.ipAdapters.entities.forEach(({ id, imageObject }) => { + if (imageObject?.image.name === imageDTO.image_name) { dispatch(ipaImageChanged({ id, imageDTO: null })); } }); }; const deleteLayerImages = (state: RootState, dispatch: AppDispatch, imageDTO: ImageDTO) => { - state.canvasV2.layers.forEach(({ id, objects }) => { + state.canvasV2.layers.entities.forEach(({ id, objects }) => { let shouldDelete = false; for (const obj of objects) { if (obj.type === 'image' && obj.image.name === imageDTO.image_name) {