fix(ui): do not empty selection when board ID selected or gallery view changed

We will be setting the selection in just a moment anyways.
This commit is contained in:
psychedelicious
2024-09-26 07:20:13 +10:00
committed by Kent Keirsey
parent 39585ccac0
commit fa6e0583bc

View File

@@ -1,12 +1,7 @@
import { isAnyOf } from '@reduxjs/toolkit';
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware';
import { selectListImagesQueryArgs } from 'features/gallery/store/gallerySelectors';
import {
boardIdSelected,
galleryViewChanged,
imageSelected,
selectionChanged,
} from 'features/gallery/store/gallerySlice';
import { boardIdSelected, galleryViewChanged, imageSelected } from 'features/gallery/store/gallerySlice';
import { imagesApi } from 'services/api/endpoints/images';
export const addBoardIdSelectedListener = (startAppListening: AppStartListening) => {
@@ -20,8 +15,6 @@ export const addBoardIdSelectedListener = (startAppListening: AppStartListening)
const queryArgs = selectListImagesQueryArgs(state);
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(