File tree Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Fix BuyWidget autoconnect not working when receiverAddress prop is set
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import type {
2525import type { CompletedStatusResult } from "../../../core/hooks/useStepExecutor.js" ;
2626import type { SupportedTokens } from "../../../core/utils/defaultTokens.js" ;
2727import { webWindowAdapter } from "../../adapters/WindowAdapter.js" ;
28+ import { AutoConnect } from "../AutoConnect/AutoConnect.js" ;
2829import connectLocaleEn from "../ConnectWallet/locale/en.js" ;
2930import { EmbedContainer } from "../ConnectWallet/Modal/ConnectEmbed.js" ;
3031import { DynamicHeight } from "../components/DynamicHeight.js" ;
@@ -359,6 +360,21 @@ export function BuyWidget(props: BuyWidgetProps) {
359360 className = { props . className }
360361 style = { props . style }
361362 >
363+ { props . connectOptions ?. autoConnect !== false && (
364+ < AutoConnect
365+ client = { props . client }
366+ wallets = { props . connectOptions ?. wallets }
367+ timeout = {
368+ typeof props . connectOptions ?. autoConnect === "object"
369+ ? props . connectOptions ?. autoConnect ?. timeout
370+ : undefined
371+ }
372+ appMetadata = { props . connectOptions ?. appMetadata }
373+ accountAbstraction = { props . connectOptions ?. accountAbstraction }
374+ chain = { props . connectOptions ?. chain }
375+ />
376+ ) }
377+
362378 < BridgeWidgetContent
363379 { ...props }
364380 theme = { props . theme || "dark" }
Original file line number Diff line number Diff line change @@ -298,6 +298,7 @@ export function FundWallet(props: FundWalletProps) {
298298 } }
299299 theme = { theme }
300300 { ...props . connectOptions }
301+ autoConnect = { false }
301302 />
302303 ) : (
303304 < Button
Original file line number Diff line number Diff line change @@ -138,6 +138,20 @@ export function LargeAmount() {
138138 ) ;
139139}
140140
141+ export function NoAutoConnect ( ) {
142+ return (
143+ < Variant
144+ client = { storyClient }
145+ chain = { ethereum }
146+ tokenAddress = "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
147+ amount = "150000"
148+ connectOptions = { {
149+ autoConnect : false ,
150+ } }
151+ />
152+ ) ;
153+ }
154+
141155function Variant ( props : BuyWidgetProps ) {
142156 return (
143157 < div
You can’t perform that action at this time.
0 commit comments