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 { IconButton } from '@invoke-ai/ui-library';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
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 { memo, useCallback, useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { PiPlusBold } from 'react-icons/pi';
|
import { PiPlusBold } from 'react-icons/pi';
|
||||||
@ -24,10 +24,12 @@ const AddBoardButton = ({ isPrivateBoard }: Props) => {
|
|||||||
}
|
}
|
||||||
return t('boards.addSharedBoard');
|
return t('boards.addSharedBoard');
|
||||||
}, [allowPrivateBoards, isPrivateBoard, t]);
|
}, [allowPrivateBoards, isPrivateBoard, t]);
|
||||||
|
|
||||||
const handleCreateBoard = useCallback(async () => {
|
const handleCreateBoard = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const board = await createBoard({ board_name: t('boards.myBoard'), is_private: isPrivateBoard }).unwrap();
|
const board = await createBoard({ board_name: t('boards.myBoard'), is_private: isPrivateBoard }).unwrap();
|
||||||
dispatch(boardIdSelected({ boardId: board.board_id }));
|
dispatch(boardIdSelected({ boardId: board.board_id }));
|
||||||
|
dispatch(boardSearchTextChanged(''));
|
||||||
} catch {
|
} catch {
|
||||||
//no-op
|
//no-op
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,10 @@ import { PiImagesBold, PiMagnifyingGlassBold } from 'react-icons/pi';
|
|||||||
|
|
||||||
import BoardsList from './Boards/BoardsList/BoardsList';
|
import BoardsList from './Boards/BoardsList/BoardsList';
|
||||||
import GalleryBoardName from './GalleryBoardName';
|
import GalleryBoardName from './GalleryBoardName';
|
||||||
|
import GallerySettingsPopover from './GallerySettingsPopover/GallerySettingsPopover';
|
||||||
import GalleryImageGrid from './ImageGrid/GalleryImageGrid';
|
import GalleryImageGrid from './ImageGrid/GalleryImageGrid';
|
||||||
import { GalleryPagination } from './ImageGrid/GalleryPagination';
|
import { GalleryPagination } from './ImageGrid/GalleryPagination';
|
||||||
import { GallerySearch } from './ImageGrid/GallerySearch';
|
import { GallerySearch } from './ImageGrid/GallerySearch';
|
||||||
import GallerySettingsPopover from './GallerySettingsPopover/GallerySettingsPopover';
|
|
||||||
|
|
||||||
const baseStyles: ChakraProps['sx'] = {
|
const baseStyles: ChakraProps['sx'] = {
|
||||||
fontWeight: 'semibold',
|
fontWeight: 'semibold',
|
||||||
|
Loading…
Reference in New Issue
Block a user