fix(ui): fix canvas staging area

Missed some of the `imageUpdated` stuff
This commit is contained in:
psychedelicious 2023-06-24 11:26:08 +10:00
parent bab3a9504e
commit a6c615a98c
4 changed files with 12 additions and 11 deletions

View File

@ -19,8 +19,8 @@ export const addImageMetadataReceivedFulfilledListener = () => {
) {
dispatch(
imageUpdated({
imageName: image.image_name,
requestBody: { is_intermediate: false },
image_name: image.image_name,
is_intermediate: image.is_intermediate,
})
);
} else if (image.is_intermediate) {

View File

@ -11,14 +11,12 @@ export const addStagingAreaImageSavedListener = () => {
startAppListening({
actionCreator: stagingAreaImageSaved,
effect: async (action, { dispatch, getState, take }) => {
const { image_name } = action.payload;
const { imageName } = action.payload;
dispatch(
imageUpdated({
imageName: image_name,
requestBody: {
is_intermediate: false,
},
image_name: imageName,
is_intermediate: false,
})
);
@ -26,7 +24,7 @@ export const addStagingAreaImageSavedListener = () => {
(action) =>
(imageUpdated.fulfilled.match(action) ||
imageUpdated.rejected.match(action)) &&
action.meta.arg.imageName === image_name
action.meta.arg.image_name === imageName
);
if (imageUpdated.rejected.match(imageUpdatedAction)) {

View File

@ -175,7 +175,11 @@ const IAICanvasStagingAreaToolbar = () => {
aria-label={t('unifiedCanvas.saveToGallery')}
icon={<FaSave />}
onClick={() =>
dispatch(stagingAreaImageSaved(currentStagingAreaImage.image))
dispatch(
stagingAreaImageSaved({
imageName: currentStagingAreaImage.imageName,
})
)
}
colorScheme="accent"
/>

View File

@ -1,5 +1,4 @@
import { createAction } from '@reduxjs/toolkit';
import { ImageDTO } from 'services/api/types';
export const canvasSavedToGallery = createAction('canvas/canvasSavedToGallery');
@ -13,6 +12,6 @@ export const canvasDownloadedAsImage = createAction(
export const canvasMerged = createAction('canvas/canvasMerged');
export const stagingAreaImageSaved = createAction<ImageDTO>(
export const stagingAreaImageSaved = createAction<{ imageName: string }>(
'canvas/stagingAreaImageSaved'
);