File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Add support for filtering fiat payment providers in PayEmbed
Original file line number Diff line number Diff line change @@ -86,10 +86,14 @@ export function FiatScreenContent(props: {
8686 const supportedProviders = ( ( ) => {
8787 if ( ! buyWithFiatOptions ) return [ ...FiatProviders ] ;
8888 const options = buyWithFiatOptions ?. supportedProviders ?? [ ] ;
89- return options . length > 0 &&
90- ( ! preferredProvider || options . includes ( preferredProvider ) )
91- ? options
92- : [ ...FiatProviders ] ;
89+ const optionsWithPreferred =
90+ options . length > 0
91+ ? new Set ( [
92+ ...( preferredProvider ? [ preferredProvider ] : [ ] ) ,
93+ ...options ,
94+ ] )
95+ : FiatProviders ;
96+ return Array . from ( optionsWithPreferred ) ;
9397 } ) ( ) ;
9498
9599 const fiatQuoteQuery = useBuyWithFiatQuote (
@@ -106,8 +110,8 @@ export function FiatScreenContent(props: {
106110 isTestMode : buyWithFiatOptions ?. testMode ,
107111 purchaseData : props . payOptions . purchaseData ,
108112 fromAddress : payer . account . address ,
109- preferredProvider : preferredProvider ,
110113 paymentLinkId : paymentLinkId ,
114+ preferredProvider : preferredProvider ?? "COINBASE" ,
111115 }
112116 : undefined ,
113117 ) ;
You can’t perform that action at this time.
0 commit comments