Skip to content
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/violet-areas-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Always connect to destination chain if available in PayEmbed
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ function BuyScreenContent(props: BuyScreenContentProps) {
<WalletSwitcherConnectionScreen
accountAbstraction={props.connectOptions?.accountAbstraction}
appMetadata={props.connectOptions?.appMetadata}
chain={props.connectOptions?.chain}
chains={props.connectOptions?.chains}
chain={toChain || props.connectOptions?.chain}
chains={[toChain, ...(props.connectOptions?.chains || [])]}
Comment on lines +274 to +275
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current change always prioritizes the destination chain (toChain) which is causing test failures. We should only use toChain when it's explicitly needed for the payment flow, and preserve the original chain configuration in test environments. Consider adding a condition to check if we're in a test environment or if the original chain should be preserved for certain operations.

Spotted by Diamond (based on CI logs)

Is this helpful? React 👍 or 👎 to let us know.

client={props.client}
connectLocale={props.connectLocale}
isEmbed={props.isEmbed}
Expand Down
Loading