-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feat(snaps): Add getAddressDisplayName
selector
#27868
base: develop
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
getAddressDisplayName
selectorgetAddressDisplayName
selector
3037ac7
to
240d3df
Compare
Builds ready [240d3df]
Page Load Metrics (1667 ± 140 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
); | ||
|
||
return ( | ||
(accountName === '' ? undefined : accountName) ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metamask-extension/ui/selectors/selectors.js
Line 641 in 04b17ff
export function getAccountName(accounts, accountAddress) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well, maybe good reason to use ||
then, Just leave a comment about why
f23eff0
to
6a45a0e
Compare
* @param {string} address - The address to get the display name for in a CAIP-10 format. | ||
* @returns {string} The display name for the address. | ||
*/ | ||
export const getAddressDisplayName = createDeepEqualSelector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don' think the memoization will be effective if we pass in the entire raw state. Wondering how we can structure this to only reference the state we need 🤔
Quality Gate passedIssues Measures |
Description
This PR adds a selector to get the display name or the address book entry for an address (in CAIP-10 or Hex format).
Related issues
Manual testing steps
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist