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(
932
932
payOptions : PayUIOptions ,
933
933
supportedTokensOverrides ?: SupportedTokens ,
934
934
) : SupportedTokens {
935
- const tokens : SupportedTokens = { } ;
935
+ // dev override
936
+ if ( supportedTokensOverrides ) {
937
+ return supportedTokensOverrides ;
938
+ }
936
939
940
+ const tokens : SupportedTokens = { } ;
937
941
const isBuyWithFiatDisabled = payOptions . buyWithFiat === false ;
938
942
const isBuyWithCryptoDisabled = payOptions . buyWithCrypto === false ;
939
943
940
- // FIXME (pay) when buywithFiat is disabled, missing a bunch of tokens on base??
941
-
942
944
for ( const x of data ) {
943
945
tokens [ x . chain . id ] = x . tokens . filter ( ( t ) => {
944
946
// for source tokens, data is not provided, so we include all of them
@@ -966,19 +968,6 @@ function createSupportedTokens(
966
968
return true ; // include the token
967
969
} ) ;
968
970
}
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
-
982
971
return tokens ;
983
972
}
984
973
You can’t perform that action at this time.
0 commit comments