diff --git a/projects/website/src/components/friend/add-friend.tsx b/projects/website/src/components/friend/add-friend.tsx index 61e6fb8..96d88ad 100644 --- a/projects/website/src/components/friend/add-friend.tsx +++ b/projects/website/src/components/friend/add-friend.tsx @@ -36,6 +36,11 @@ export default function AddFriend({ player }: Props) { }); } + // Database is not ready + if (settings == undefined || database == undefined) { + return null; + } + // If the player is already a friend, don't show the button if (isFriend || settings?.playerId == id) { return null; diff --git a/projects/website/src/components/player/claim-profile.tsx b/projects/website/src/components/player/claim-profile.tsx index 3921468..444ddbc 100644 --- a/projects/website/src/components/player/claim-profile.tsx +++ b/projects/website/src/components/player/claim-profile.tsx @@ -36,7 +36,12 @@ export default function ClaimProfile({ playerId }: Props) { revalidatePath("/player/[...slug]"); } - if (settings?.playerId == playerId || settings == undefined) { + // Database is not ready + if (settings == undefined || database == undefined) { + return null; + } + + if (settings?.playerId == playerId) { return null; // Don't show the claim button if it's the same user. }