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

UX: Allow quick Add Account name based on default name #20168

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const CreateAccount = ({ onActionComplete }) => {
const { isValidAccountName, errorMessage } = getAccountNameErrorMessage(
accounts,
{ t },
newAccountName,
newAccountName === '' ? defaultAccountName : newAccountName,
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be shortened and clarified to:
newAccountName ?? defaultAccountName

Copy link
Member

Choose a reason for hiding this comment

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

This ended up nullifying the change. The ?? operator only checks for null and undefined, but the newAccountName is always an empty string if it's unset (never nullish). So the default account name is never used here, leaving the behavior of the component exactly as it was before.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh my! Should I fix this? I guess it should be || instead of ??

Copy link
Member

Choose a reason for hiding this comment

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

Yeah exactly! || should work well here. A fix would be appreciated.

We found this during RC testing but this improvement wasn't urgent, so we removed it from the RC. That is, fixing this isn't urgent, so no rush.

defaultAccountName,
);

Expand Down
Loading