Skip to content

Commit

Permalink
fix(UserComboBox): getting user name
Browse files Browse the repository at this point in the history
  • Loading branch information
LamaEats committed Sep 28, 2023
1 parent 0160671 commit 10e7d3e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/UserComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ export const UserComboBox = React.forwardRef<HTMLDivElement, UserComboBoxProps>(
}

const current = prepareUserDataFromActivity(value);
if (current != null) {
const existingName = getUserName(current);

return existingName;
if (current != null) {
return getUserName(current);
}

return query;
Expand All @@ -78,7 +77,9 @@ export const UserComboBox = React.forwardRef<HTMLDivElement, UserComboBoxProps>(
if (value) {
const current = prepareUserDataFromActivity(value);

return current?.name || current?.email || text;
if (current) {
return getUserName(current);
}
}

return text;
Expand Down

0 comments on commit 10e7d3e

Please sign in to comment.