From 18b0271462f323918025e992b6e98248f609133d Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 19 Jul 2023 17:57:12 -0400 Subject: [PATCH] minor fixes --- components/Modal/Collection/TeamManagement.tsx | 6 +++--- lib/client/addMemberToCollection.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/Modal/Collection/TeamManagement.tsx b/components/Modal/Collection/TeamManagement.tsx index 57d42ed..fe00eb6 100644 --- a/components/Modal/Collection/TeamManagement.tsx +++ b/components/Modal/Collection/TeamManagement.tsx @@ -163,7 +163,7 @@ export default function TeamManagement({
{ setMember({ ...member, @@ -174,7 +174,7 @@ export default function TeamManagement({ e.key === "Enter" && addMemberToCollection( session.data?.user.username as string, - member.user.username, + member.user.username || "", collection, setMemberState ) @@ -188,7 +188,7 @@ export default function TeamManagement({ onClick={() => addMemberToCollection( session.data?.user.username as string, - member.user.username, + member.user.username || "", collection, setMemberState ) diff --git a/lib/client/addMemberToCollection.ts b/lib/client/addMemberToCollection.ts index f1ec14f..3e705ec 100644 --- a/lib/client/addMemberToCollection.ts +++ b/lib/client/addMemberToCollection.ts @@ -9,7 +9,7 @@ const addMemberToCollection = async ( setMember: (newMember: Member) => null | undefined ) => { const checkIfMemberAlreadyExists = collection.members.find((e) => { - const username = e.user.username.toLowerCase(); + const username = (e.user.username || "").toLowerCase(); return username === memberUsername.toLowerCase(); });