File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed
wrap/src/components/WrapForm Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 1+ wrap: Show error message if amount can not be parsed
Original file line number Diff line number Diff line change @@ -90,19 +90,23 @@ export const WrapForm: FC = () => {
9090 setError ( '' )
9191 e . preventDefault ( )
9292
93- const amount = NumberUtils . BigIntToBN ( parseEther ( value || '0' ) )
94-
95- if (
96- formType === WrapFormType . WRAP &&
97- NumberUtils . shouldShowWrapFeeWarningModal ( {
98- fee : estimatedFee ,
99- amount,
100- accountBalanceAmount : balance ,
101- } )
102- ) {
103- setIsWrapFeeModalOpen ( true )
104- } else {
105- submitTransaction ( amount )
93+ try {
94+ const amount = NumberUtils . BigIntToBN ( parseEther ( value || '0' ) )
95+
96+ if (
97+ formType === WrapFormType . WRAP &&
98+ NumberUtils . shouldShowWrapFeeWarningModal ( {
99+ fee : estimatedFee ,
100+ amount,
101+ accountBalanceAmount : balance ,
102+ } )
103+ ) {
104+ setIsWrapFeeModalOpen ( true )
105+ } else {
106+ submitTransaction ( amount )
107+ }
108+ } catch ( ex ) {
109+ setError ( ( ex as BaseError ) ?. shortMessage || ( ex as Error ) ?. message || JSON . stringify ( ex ) )
106110 }
107111 }
108112
You can’t perform that action at this time.
0 commit comments