Skip to content

Commit

Permalink
🚸(frontend) simplify invite user row logic in DocShareModal
Browse files Browse the repository at this point in the history
Refactor the endActions logic to show invite user row when searching by
email, removing the unnecessary length check for users
  • Loading branch information
PanchoutNathan authored and sampaccoud committed Jan 28, 2025
1 parent 492193e commit 9be5ae4
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,14 @@ export const DocShareModal = ({ doc, onClose }: Props) => {
return {
groupName: t('Search user result'),
elements: users,
endActions:
isEmail && users.length === 0
? [
{
content: <DocShareModalInviteUserRow user={newUser} />,
onSelect: () => void onSelect(newUser),
},
]
: undefined,
endActions: isEmail
? [
{
content: <DocShareModalInviteUserRow user={newUser} />,
onSelect: () => void onSelect(newUser),
},
]
: undefined,
};
}, [searchUsersQuery.data, t, userQuery]);

Expand Down

0 comments on commit 9be5ae4

Please sign in to comment.