File tree Expand file tree Collapse file tree 4 files changed +17
-43
lines changed
packages/thirdweb/src/react
web/ui/ConnectWallet/screens/Buy Expand file tree Collapse file tree 4 files changed +17
-43
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Dont retry on quote errors, show fiat value in every step
Original file line number Diff line number Diff line change @@ -97,26 +97,6 @@ export function useBuyWithCryptoQuote(
9797 return getBuyWithCryptoQuote ( params ) ;
9898 } ,
9999 enabled : ! ! params ,
100- retry ( failureCount , error ) {
101- if ( failureCount > 3 ) {
102- return false ;
103- }
104- try {
105- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
106- const serverError = ( error as any ) . error as BuyWithCryptoQuoteError ;
107-
108- if ( serverError . code === "MINIMUM_PURCHASE_AMOUNT" ) {
109- return false ;
110- }
111-
112- if ( serverError . statusCode === 404 || serverError . statusCode >= 500 ) {
113- return false ;
114- }
115- } catch {
116- return true ;
117- }
118-
119- return true ;
120- } ,
100+ retry : false ,
121101 } ) ;
122102}
Original file line number Diff line number Diff line change @@ -85,26 +85,6 @@ export function useBuyWithFiatQuote(
8585 return getBuyWithFiatQuote ( params ) ;
8686 } ,
8787 enabled : ! ! params ,
88- retry ( failureCount , error ) {
89- if ( failureCount > 3 ) {
90- return false ;
91- }
92- try {
93- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
94- const serverError = ( error as any ) . error as BuyWithFiatQuoteError ;
95-
96- if ( serverError . code === "MINIMUM_PURCHASE_AMOUNT" ) {
97- return false ;
98- }
99-
100- if ( serverError . statusCode === 404 || serverError . statusCode >= 500 ) {
101- return false ;
102- }
103- } catch {
104- return true ;
105- }
106-
107- return true ;
108- } ,
88+ retry : false ,
10989 } ) ;
11090}
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ import {
5252 useToTokenSelectionStates ,
5353} from "./main/useUISelectionStates.js" ;
5454import { BuyTokenInput } from "./swap/BuyTokenInput.js" ;
55+ import { FiatValue } from "./swap/FiatValue.js" ;
5556import { PaymentSelectionScreen } from "./swap/PaymentSelectionScreen.js" ;
5657import { SwapFlow } from "./swap/SwapFlow.js" ;
5758import { SwapScreenContent } from "./swap/SwapScreenContent.js" ;
@@ -669,7 +670,7 @@ function SelectedTokenInfo(props: {
669670 justifyContent : "space-between" ,
670671 } }
671672 >
672- < Container flex = "row" gap = "xs " center = "y" >
673+ < Container flex = "row" gap = "xxs " center = "y" >
673674 < Input
674675 variant = "outline"
675676 pattern = "^[0-9]*[.,]?[0-9]*$"
@@ -738,6 +739,14 @@ function SelectedTokenInfo(props: {
738739 token = { props . selectedToken }
739740 />
740741 </ Container >
742+
743+ < FiatValue
744+ chain = { props . selectedChain }
745+ client = { props . client }
746+ tokenAmount = { props . tokenAmount }
747+ token = { props . selectedToken }
748+ size = "sm"
749+ />
741750 </ Container >
742751
743752 < ChainName
You can’t perform that action at this time.
0 commit comments