fix these showing when they shouldn't
All checks were successful
Deploy Website / deploy (push) Successful in 5m35s

This commit is contained in:
Lee 2024-10-19 09:07:01 +01:00
parent 4eb96da1f1
commit de05aceb9f
2 changed files with 11 additions and 1 deletions

View File

@ -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;

View File

@ -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.
}