This commit is contained in:
Mary Hipp 2024-06-25 15:17:52 -04:00 committed by psychedelicious
parent 4c914ef2e8
commit 93ffcb642e
2 changed files with 8 additions and 3 deletions

View File

@ -1,8 +1,13 @@
import { isAnyOf } from '@reduxjs/toolkit'; import { isAnyOf } from '@reduxjs/toolkit';
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware'; import type { AppStartListening } from 'app/store/middleware/listenerMiddleware';
import { boardIdSelected, galleryViewChanged, imageSelected, selectionChanged } from 'features/gallery/store/gallerySlice'; import { selectListImagesQueryArgs } from 'features/gallery/store/gallerySelectors';
import {
boardIdSelected,
galleryViewChanged,
imageSelected,
selectionChanged,
} from 'features/gallery/store/gallerySlice';
import { imagesApi } from 'services/api/endpoints/images'; import { imagesApi } from 'services/api/endpoints/images';
import { selectListImagesQueryArgs } from '../../../../../features/gallery/store/gallerySelectors';
export const addBoardIdSelectedListener = (startAppListening: AppStartListening) => { export const addBoardIdSelectedListener = (startAppListening: AppStartListening) => {
startAppListening({ startAppListening({

View File

@ -150,7 +150,7 @@ export const addRequestedSingleImageDeletionListener = (startAppListening: AppSt
const { data } = imagesApi.endpoints.listImages.select(baseQueryArgs)(state); const { data } = imagesApi.endpoints.listImages.select(baseQueryArgs)(state);
if (data && data.items) { if (data && data.items) {
const newlySelectedImage = data?.items.find(img => img.image_name !== imageDTO?.image_name) const newlySelectedImage = data?.items.find((img) => img.image_name !== imageDTO?.image_name);
dispatch(imageSelected(newlySelectedImage || null)); dispatch(imageSelected(newlySelectedImage || null));
} else { } else {
dispatch(imageSelected(null)); dispatch(imageSelected(null));