From 30a4aecaba53875caecca9a16b567ba1f4eb2772 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Sat, 19 Apr 2025 21:14:35 +1200 Subject: [PATCH] [SDK] Fix loading state in PayEmbed source tokens --- .changeset/tender-parrots-stare.md | 5 +++++ .../screens/Buy/swap/TokenSelectorScreen.tsx | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/tender-parrots-stare.md diff --git a/.changeset/tender-parrots-stare.md b/.changeset/tender-parrots-stare.md new file mode 100644 index 00000000000..4454f93f3c9 --- /dev/null +++ b/.changeset/tender-parrots-stare.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fix loading state when loading source tokens in PayEmbed diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx index c839805dbab..93e6972711c 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx @@ -176,7 +176,12 @@ export function TokenSelectorScreen(props: { enabled: !!props.sourceSupportedTokens && !!chainInfo.data, }); - if (walletsAndBalances.isLoading || chainInfo.isLoading) { + if ( + walletsAndBalances.isLoading || + chainInfo.isLoading || + !chainInfo.data || + !props.sourceSupportedTokens + ) { return ; } @@ -307,6 +312,7 @@ function WalletRowWithBalances(props: { style={{ borderRadius: radius.lg, border: `1px solid ${theme.colors.borderColor}`, + minHeight: "350px", }} >