Skip to content

Commit

Permalink
bugfix: Updated role defaults to cover undefined cases (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
escobarjonatan authored May 13, 2024
1 parent 6db4684 commit bb3128c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/studio/src/pages/createProfile/CreateProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const CreateProfile: FunctionComponent = () => {
lastName,
location,
nickname,
role,
role: role || "",
};

/**
Expand Down
14 changes: 8 additions & 6 deletions packages/elements/src/lib/form/FilteredTagsField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ const FilteredTagsField: FunctionComponent<FilteredTagsFieldProps> = ({
* that match the query string. Once the query string exactly matches a
* tag, hide the remaining tag.
*/
const filterTags = (query: string) => (tag: string) => {
const emptyQuery = query.length === 0;
const queryExactlyMatchesTag = tag === query;
const tagIncludesQuery = tag.toLowerCase().includes(query.toLowerCase());
const filterTags =
(query = "") =>
(tag: string) => {
const emptyQuery = query.length === 0;
const queryExactlyMatchesTag = tag === query;
const tagIncludesQuery = tag.toLowerCase().includes(query.toLowerCase());

return emptyQuery || (!queryExactlyMatchesTag && tagIncludesQuery);
};
return emptyQuery || (!queryExactlyMatchesTag && tagIncludesQuery);
};

export default FilteredTagsField;

0 comments on commit bb3128c

Please sign in to comment.