From 4c914ef2e814a23a10acb4929e21a9ba22652607 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Tue, 25 Jun 2024 15:12:21 -0400 Subject: [PATCH] use correct query params for boardIdSelected listener --- .../listeners/boardIdSelected.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts index 66e010b870..e9efa01d9a 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts @@ -1,13 +1,8 @@ import { isAnyOf } from '@reduxjs/toolkit'; import type { AppStartListening } from 'app/store/middleware/listenerMiddleware'; -import { - boardIdSelected, - galleryViewChanged, - imageSelected, - selectionChanged, -} from 'features/gallery/store/gallerySlice'; -import { ASSETS_CATEGORIES, IMAGE_CATEGORIES } from 'features/gallery/store/types'; +import { boardIdSelected, galleryViewChanged, imageSelected, selectionChanged } from 'features/gallery/store/gallerySlice'; import { imagesApi } from 'services/api/endpoints/images'; +import { selectListImagesQueryArgs } from '../../../../../features/gallery/store/gallerySelectors'; export const addBoardIdSelectedListener = (startAppListening: AppStartListening) => { startAppListening({ @@ -18,14 +13,7 @@ export const addBoardIdSelectedListener = (startAppListening: AppStartListening) const state = getState(); - const board_id = boardIdSelected.match(action) ? action.payload.boardId : state.gallery.selectedBoardId; - - const galleryView = galleryViewChanged.match(action) ? action.payload : state.gallery.galleryView; - - // when a board is selected, we need to wait until the board has loaded *some* images, then select the first one - const categories = galleryView === 'images' ? IMAGE_CATEGORIES : ASSETS_CATEGORIES; - - const queryArgs = { board_id: board_id ?? 'none', categories }; + const queryArgs = selectListImagesQueryArgs(state); dispatch(selectionChanged([]));