mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
(ui): update boards list queries to only use sort params for list, and make sure archived boards are included in most places we are searching
This commit is contained in:
committed by
Mary Hipp Rogers
parent
9933cdb6b7
commit
8d44363d49
@@ -44,10 +44,9 @@ export const checkImageAccess = async (name: string): Promise<boolean> => {
|
||||
* @returns A promise that resolves to true if the client has access, else false.
|
||||
*/
|
||||
export const checkBoardAccess = async (id: string): Promise<boolean> => {
|
||||
const { dispatch, getState } = getStore();
|
||||
const { dispatch } = getStore();
|
||||
try {
|
||||
const queryArgs = selectListBoardsQueryArgs(getState());
|
||||
const req = dispatch(boardsApi.endpoints.listAllBoards.initiate(queryArgs));
|
||||
const req = dispatch(boardsApi.endpoints.listAllBoards.initiate({include_archived: true}));
|
||||
req.unsubscribe();
|
||||
const result = await req.unwrap();
|
||||
return result.some((b) => b.board_id === id);
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { selectListBoardsQueryArgs } from 'features/gallery/store/gallerySelectors';
|
||||
import type { BoardId } from 'features/gallery/store/types';
|
||||
import { t } from 'i18next';
|
||||
import { useListAllBoardsQuery } from 'services/api/endpoints/boards';
|
||||
|
||||
export const useBoardName = (board_id: BoardId) => {
|
||||
const queryArgs = useAppSelector(selectListBoardsQueryArgs);
|
||||
const { boardName } = useListAllBoardsQuery(queryArgs, {
|
||||
const { boardName } = useListAllBoardsQuery({include_archived: true}, {
|
||||
selectFromResult: ({ data }) => {
|
||||
const selectedBoard = data?.find((b) => b.board_id === board_id);
|
||||
const boardName = selectedBoard?.board_name || t('boards.uncategorized');
|
||||
|
||||
Reference in New Issue
Block a user