Fix custom names and buttonref

This commit is contained in:
armaniferrante 2021-03-17 18:20:40 -07:00
parent 4a601d8355
commit 3f9222e137
No known key found for this signature in database
GPG Key ID: 58BEF301E91F7828
2 changed files with 3 additions and 1 deletions

View File

@ -407,6 +407,7 @@ function ApproveSignatureForm({
origin={origin}
messages={messages}
onApprove={onApprove}
buttonRef={buttonRef}
/>
);
};

View File

@ -291,13 +291,14 @@ export function getTokenInfo(mint, endpoint, tokenInfos) {
let match = tokenInfos?.find(
(tokenInfo) => tokenInfo.address === mint.toBase58(),
);
if (match) {
if (!info) {
info = { ...match, logoUri: match.logoURI };
}
// The user has overridden a name locally.
else {
info = { ...info, logoUri: match.logoURI };
info = { ...match, ...info, logoUri: match.logoURI };
}
}
return { ...info };