make the navbar move around less
All checks were successful
Deploy Website / deploy (push) Successful in 4m59s

This commit is contained in:
Lee 2024-10-16 11:33:24 +01:00
parent b5ae8a8ae0
commit 2367a03516

View File

@ -15,9 +15,6 @@ export default function FriendsButton() {
const database = useDatabase();
const friends = useLiveQuery(() => database.getFriends());
if (friends == undefined) {
return; // Friends haven't loaded yet
}
return (
<Popover open={open} onOpenChange={setOpen}>
@ -28,7 +25,7 @@ export default function FriendsButton() {
</NavbarButton>
</PopoverTrigger>
<PopoverContent className="p-2">
{friends.length > 0 ? (
{friends && friends.length > 0 ? (
friends.map(friend => <Friend player={friend} key={friend.id} onClick={() => setOpen(false)} />)
) : (
<div className="text-sm flex flex-col gap-2 justify-center items-center">