fix: No board name being displayed if it is empty

This commit is contained in:
blessedcoolant 2023-07-21 05:07:50 +12:00
parent ddf7ddc2c1
commit 52d56e96a5

View File

@ -30,9 +30,8 @@ const GalleryBoardName = (props: Props) => {
const numOfBoardImages = useBoardTotal(selectedBoardId);
const formattedBoardName = useMemo(() => {
if (!boardName || !numOfBoardImages) {
return '';
}
if (!boardName) return '';
if (boardName && !numOfBoardImages) return boardName;
if (boardName.length > 20) {
return `${boardName.substring(0, 20)}... (${numOfBoardImages})`;
}