mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
clear out boards search when adding a new board
This commit is contained in:
parent
f193a576a6
commit
cdacf2ecd0
@ -1,6 +1,6 @@
|
||||
import { IconButton } from '@invoke-ai/ui-library';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import { boardIdSelected } from 'features/gallery/store/gallerySlice';
|
||||
import { boardIdSelected, boardSearchTextChanged } from 'features/gallery/store/gallerySlice';
|
||||
import { memo, useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { PiPlusBold } from 'react-icons/pi';
|
||||
@ -24,10 +24,12 @@ const AddBoardButton = ({ isPrivateBoard }: Props) => {
|
||||
}
|
||||
return t('boards.addSharedBoard');
|
||||
}, [allowPrivateBoards, isPrivateBoard, t]);
|
||||
|
||||
const handleCreateBoard = useCallback(async () => {
|
||||
try {
|
||||
const board = await createBoard({ board_name: t('boards.myBoard'), is_private: isPrivateBoard }).unwrap();
|
||||
dispatch(boardIdSelected({ boardId: board.board_id }));
|
||||
dispatch(boardSearchTextChanged(''));
|
||||
} catch {
|
||||
//no-op
|
||||
}
|
||||
|
@ -10,10 +10,10 @@ import { PiImagesBold, PiMagnifyingGlassBold } from 'react-icons/pi';
|
||||
|
||||
import BoardsList from './Boards/BoardsList/BoardsList';
|
||||
import GalleryBoardName from './GalleryBoardName';
|
||||
import GallerySettingsPopover from './GallerySettingsPopover/GallerySettingsPopover';
|
||||
import GalleryImageGrid from './ImageGrid/GalleryImageGrid';
|
||||
import { GalleryPagination } from './ImageGrid/GalleryPagination';
|
||||
import { GallerySearch } from './ImageGrid/GallerySearch';
|
||||
import GallerySettingsPopover from './GallerySettingsPopover/GallerySettingsPopover';
|
||||
|
||||
const baseStyles: ChakraProps['sx'] = {
|
||||
fontWeight: 'semibold',
|
||||
|
Loading…
Reference in New Issue
Block a user