mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): make isPrivate required on BoardsList
This commit is contained in:
parent
ca8441a32f
commit
4e49689d46
@ -13,7 +13,11 @@ import AddBoardButton from './AddBoardButton';
|
|||||||
import GalleryBoard from './GalleryBoard';
|
import GalleryBoard from './GalleryBoard';
|
||||||
import NoBoardBoard from './NoBoardBoard';
|
import NoBoardBoard from './NoBoardBoard';
|
||||||
|
|
||||||
export const BoardsList = ({ isPrivate }: { isPrivate?: boolean }) => {
|
type Props = {
|
||||||
|
isPrivate: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const BoardsList = ({ isPrivate }: Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const selectedBoardId = useAppSelector((s) => s.gallery.selectedBoardId);
|
const selectedBoardId = useAppSelector((s) => s.gallery.selectedBoardId);
|
||||||
const boardSearchText = useAppSelector((s) => s.gallery.boardSearchText);
|
const boardSearchText = useAppSelector((s) => s.gallery.boardSearchText);
|
||||||
@ -30,11 +34,9 @@ export const BoardsList = ({ isPrivate }: { isPrivate?: boolean }) => {
|
|||||||
|
|
||||||
return boards.filter((board) => {
|
return boards.filter((board) => {
|
||||||
if (boardSearchText.length) {
|
if (boardSearchText.length) {
|
||||||
return (
|
return board.is_private === isPrivate && board.board_name.toLowerCase().includes(boardSearchText.toLowerCase());
|
||||||
board.is_private === !!isPrivate && board.board_name.toLowerCase().includes(boardSearchText.toLowerCase())
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
return board.is_private === !!isPrivate;
|
return board.is_private === isPrivate;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, [boardSearchText, boards, isPrivate]);
|
}, [boardSearchText, boards, isPrivate]);
|
||||||
|
@ -20,7 +20,7 @@ const BoardsListWrapper = () => {
|
|||||||
<Box position="absolute" top={0} right={0} bottom={0} left={0}>
|
<Box position="absolute" top={0} right={0} bottom={0} left={0}>
|
||||||
<OverlayScrollbarsComponent defer style={overlayScrollbarsStyles} options={overlayScrollbarsParams.options}>
|
<OverlayScrollbarsComponent defer style={overlayScrollbarsStyles} options={overlayScrollbarsParams.options}>
|
||||||
{allowPrivateBoards && <BoardsList isPrivate={true} />}
|
{allowPrivateBoards && <BoardsList isPrivate={true} />}
|
||||||
<BoardsList />
|
<BoardsList isPrivate={false} />
|
||||||
</OverlayScrollbarsComponent>
|
</OverlayScrollbarsComponent>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
Loading…
Reference in New Issue
Block a user