Don't show spinner if pinned items is undefined or zero

This commit is contained in:
Pico2x 2022-10-12 18:12:32 +01:00
parent e44fc8ae13
commit 2cda3a4d4f

View File

@ -192,7 +192,9 @@ function GroupOverviewPinned(props: {
updateGroup(group, { pinnedItems: newPinned })
}
return isEditable || (group.pinnedItems && group.pinnedItems.length > 0) ? (
if (!group.pinnedItems || group.pinnedItems.length == 0) return <></>
return isEditable || (group.pinnedItems && group?.pinnedItems.length > 0) ? (
<PinnedItems
posts={posts}
group={group}