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

show token details for standalone transfer summary #1203

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

piyalbasu
Copy link
Contributor

No description provided.

@@ -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)) {
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@piyalbasu piyalbasu requested a review from quietbits March 20, 2024 20:46
@@ -218,7 +221,7 @@ type TokenDetailMap = Record<string, TokenDetails>;

const TransferSummary = ({
transfer,
tokenDetails,
tokenDetails = { name: "", symbol: "", decimals: 0 },
Copy link
Contributor Author

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;
Copy link
Contributor

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.

@piyalbasu piyalbasu merged commit ff6d20a into release/5.17.5 Mar 20, 2024
3 checks passed
@piyalbasu piyalbasu deleted the bugfix/standalone-token-transfer-details branch March 20, 2024 21:00
@piyalbasu piyalbasu mentioned this pull request Mar 20, 2024
piyalbasu added a commit that referenced this pull request Mar 20, 2024
* show token details for standalone transfer summary

* rm unnecessary check

* rm unnecessary optional chaining
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants