mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
handle 0 images/assets
This commit is contained in:
parent
16f48a816f
commit
eadbe6abf7
@ -77,12 +77,12 @@ const GalleryBoard = ({
|
|||||||
const { data: imagesTotal } = useGetBoardImagesTotalQuery(board.board_id);
|
const { data: imagesTotal } = useGetBoardImagesTotalQuery(board.board_id);
|
||||||
const { data: assetsTotal } = useGetBoardAssetsTotalQuery(board.board_id);
|
const { data: assetsTotal } = useGetBoardAssetsTotalQuery(board.board_id);
|
||||||
const tooltip = useMemo(() => {
|
const tooltip = useMemo(() => {
|
||||||
if (!imagesTotal?.total || !assetsTotal?.total) {
|
if (imagesTotal?.total === undefined || assetsTotal?.total === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return `${imagesTotal.total} image${imagesTotal.total > 1 ? 's' : ''}, ${
|
return `${imagesTotal.total} image${imagesTotal.total === 1 ? '' : 's'}, ${
|
||||||
assetsTotal.total
|
assetsTotal.total
|
||||||
} asset${assetsTotal.total > 1 ? 's' : ''}`;
|
} asset${assetsTotal.total === 1 ? '' : 's'}`;
|
||||||
}, [assetsTotal, imagesTotal]);
|
}, [assetsTotal, imagesTotal]);
|
||||||
|
|
||||||
const { currentData: coverImage } = useGetImageDTOQuery(
|
const { currentData: coverImage } = useGetImageDTOQuery(
|
||||||
|
@ -48,12 +48,12 @@ const NoBoardBoard = memo(({ isSelected }: Props) => {
|
|||||||
const { data: imagesTotal } = useGetBoardImagesTotalQuery('none');
|
const { data: imagesTotal } = useGetBoardImagesTotalQuery('none');
|
||||||
const { data: assetsTotal } = useGetBoardAssetsTotalQuery('none');
|
const { data: assetsTotal } = useGetBoardAssetsTotalQuery('none');
|
||||||
const tooltip = useMemo(() => {
|
const tooltip = useMemo(() => {
|
||||||
if (!imagesTotal?.total || !assetsTotal?.total) {
|
if (imagesTotal?.total === undefined || assetsTotal?.total === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return `${imagesTotal.total} image${imagesTotal.total > 1 ? 's' : ''}, ${
|
return `${imagesTotal.total} image${imagesTotal.total === 1 ? '' : 's'}, ${
|
||||||
assetsTotal.total
|
assetsTotal.total
|
||||||
} asset${assetsTotal.total > 1 ? 's' : ''}`;
|
} asset${assetsTotal.total === 1 ? '' : 's'}`;
|
||||||
}, [assetsTotal, imagesTotal]);
|
}, [assetsTotal, imagesTotal]);
|
||||||
|
|
||||||
const handleMouseOver = useCallback(() => {
|
const handleMouseOver = useCallback(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user