-
Notifications
You must be signed in to change notification settings - Fork 29
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
show token details for standalone transfer summary #1203
show token details for standalone transfer summary #1203
Conversation
@@ -332,15 +336,53 @@ const AuthDetail = ({ | |||
// eslint-disable-next-line | |||
for (const transfer of transfers) { | |||
try { | |||
// eslint-disable-next-line | |||
const response = await fetch(tokenDetailsUrl(transfer.contractId)); | |||
if (isCustomNetwork(networkDetails)) { |
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.
on standalone networks, use sorobanClient.server to fetch details rather than the BE
|
||
setTokenDetails(_tokenDetails); | ||
} else { | ||
// eslint-disable-next-line |
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.
the else case is unchanged; it's just what we used to do by default before
@@ -218,7 +221,7 @@ type TokenDetailMap = Record<string, TokenDetails>; | |||
|
|||
const TransferSummary = ({ | |||
transfer, | |||
tokenDetails, | |||
tokenDetails = { name: "", symbol: "", decimals: 0 }, |
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.
adding sane defaults in case this is ever undefined
@@ -228,7 +231,7 @@ const TransferSummary = ({ | |||
}; | |||
tokenDetails: TokenDetails; | |||
}) => { | |||
const hasTokenDetails = tokenDetails.symbol && tokenDetails.decimals; | |||
const hasTokenDetails = tokenDetails?.symbol && tokenDetails?.decimals; |
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.
tokenDetails
shouldn't be undefined with the default value provided.
No description provided.