Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: Updated role defaults to cover undefined cases #616

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = "") =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to tell but this was the only change made here:
from:
(query: string)
to:
(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;
Loading