mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: No board name being displayed if it is empty (#3863)
## What type of PR is this? (check all applicable) - [x] Bug Fix ## Desc Fixes a bug where the board name is not displayed in the header if there are no images in it.
This commit is contained in:
commit
8fdc8a8da5
@ -30,9 +30,8 @@ const GalleryBoardName = (props: Props) => {
|
|||||||
const numOfBoardImages = useBoardTotal(selectedBoardId);
|
const numOfBoardImages = useBoardTotal(selectedBoardId);
|
||||||
|
|
||||||
const formattedBoardName = useMemo(() => {
|
const formattedBoardName = useMemo(() => {
|
||||||
if (!boardName || !numOfBoardImages) {
|
if (!boardName) return '';
|
||||||
return '';
|
if (boardName && !numOfBoardImages) return boardName;
|
||||||
}
|
|
||||||
if (boardName.length > 20) {
|
if (boardName.length > 20) {
|
||||||
return `${boardName.substring(0, 20)}... (${numOfBoardImages})`;
|
return `${boardName.substring(0, 20)}... (${numOfBoardImages})`;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user