File tree Expand file tree Collapse file tree 2 files changed +10
-16
lines changed
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Respect supportedTokens override in PayEmbed
Original file line number Diff line number Diff line change @@ -932,13 +932,15 @@ function createSupportedTokens(
932932 payOptions : PayUIOptions ,
933933 supportedTokensOverrides ?: SupportedTokens ,
934934) : SupportedTokens {
935- const tokens : SupportedTokens = { } ;
935+ // dev override
936+ if ( supportedTokensOverrides ) {
937+ return supportedTokensOverrides ;
938+ }
936939
940+ const tokens : SupportedTokens = { } ;
937941 const isBuyWithFiatDisabled = payOptions . buyWithFiat === false ;
938942 const isBuyWithCryptoDisabled = payOptions . buyWithCrypto === false ;
939943
940- // FIXME (pay) when buywithFiat is disabled, missing a bunch of tokens on base??
941-
942944 for ( const x of data ) {
943945 tokens [ x . chain . id ] = x . tokens . filter ( ( t ) => {
944946 // for source tokens, data is not provided, so we include all of them
@@ -966,19 +968,6 @@ function createSupportedTokens(
966968 return true ; // include the token
967969 } ) ;
968970 }
969-
970- // override with props.supportedTokens
971- if ( supportedTokensOverrides ) {
972- for ( const k in supportedTokensOverrides ) {
973- const key = Number ( k ) ;
974- const tokenList = supportedTokensOverrides [ key ] ;
975-
976- if ( tokenList ) {
977- tokens [ key ] = tokenList ;
978- }
979- }
980- }
981-
982971 return tokens ;
983972}
984973
You can’t perform that action at this time.
0 commit comments