Skip to content

[SDK] Fix loading state in PayEmbed source tokens #6778

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/tender-parrots-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Fix loading state when loading source tokens in PayEmbed
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@
enabled: !!props.sourceSupportedTokens && !!chainInfo.data,
});

if (walletsAndBalances.isLoading || chainInfo.isLoading) {
if (
walletsAndBalances.isLoading ||
chainInfo.isLoading ||
!chainInfo.data ||
!props.sourceSupportedTokens
) {

Check warning on line 184 in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx#L179-L184

Added lines #L179 - L184 were not covered by tests
return <LoadingScreen />;
}

Expand Down Expand Up @@ -307,6 +312,7 @@
style={{
borderRadius: radius.lg,
border: `1px solid ${theme.colors.borderColor}`,
minHeight: "350px",

Check warning on line 315 in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx#L315

Added line #L315 was not covered by tests
}}
>
<Container
Expand Down
Loading