clear selection when board or gallery view changes

This commit is contained in:
Mary Hipp 2024-06-24 14:27:06 -04:00 committed by psychedelicious
parent 66e25628c3
commit afb0651f91

View File

@ -1,6 +1,6 @@
import { isAnyOf } from '@reduxjs/toolkit';
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware';
import { boardIdSelected, galleryViewChanged, imageSelected } from 'features/gallery/store/gallerySlice';
import { boardIdSelected, galleryViewChanged, imageSelected, selectionChanged } from 'features/gallery/store/gallerySlice';
import { ASSETS_CATEGORIES, IMAGE_CATEGORIES } from 'features/gallery/store/types';
import { imagesApi } from 'services/api/endpoints/images';
@ -22,6 +22,8 @@ export const addBoardIdSelectedListener = (startAppListening: AppStartListening)
const queryArgs = { board_id: board_id ?? 'none', categories };
dispatch(selectionChanged([]))
// wait until the board has some images - maybe it already has some from a previous fetch
// must use getState() to ensure we do not have stale state
const isSuccess = await condition(