feat(ui): make archiving and auto-add mutually exclusive

This commit is contained in:
Mary Hipp
2024-06-26 14:15:58 -04:00
committed by psychedelicious
parent 68c0aa898f
commit 071e8bcee4
3 changed files with 11 additions and 7 deletions

View File

@@ -2,9 +2,11 @@ import type { BoardId } from 'features/gallery/store/types';
import { t } from 'i18next';
import { useListAllBoardsQuery } from 'services/api/endpoints/boards';
import { selectListBoardsQueryArgs } from '../../../features/gallery/store/gallerySelectors';
import { useAppSelector } from '../../../app/store/storeHooks';
export const useBoardName = (board_id: BoardId) => {
const { boardName } = useListAllBoardsQuery({}, {
const queryArgs = useAppSelector(selectListBoardsQueryArgs);
const { boardName } = useListAllBoardsQuery(queryArgs, {
selectFromResult: ({ data }) => {
const selectedBoard = data?.find((b) => b.board_id === board_id);
const boardName = selectedBoard?.board_name || t('boards.uncategorized');