File tree Expand file tree Collapse file tree
src/app/home/WithdrawRepay Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,20 +137,16 @@ const WithdrawRepay: React.FC<WithdrawRepayProps> = ({
137137 } ;
138138
139139 const handleSubmit = ( ) => {
140- if ( ! inputValue ) return ;
141-
142- if ( isLoadingOTokenBalance || isLoadingBalance ) {
143- throw new Error ( "Not loaded userOTokenRate!" ) ;
140+ if ( ! inputValue ) {
141+ alert ( "Please enter an amount to " + mode + "." ) ;
142+ throw new Error ( "No input amount specified." ) ;
144143 }
145144
146145 const userOTokenRate = Number ( oTokenBalance ) / Number ( lentBalance ) ;
147146
148- if ( ! userOTokenRate ) {
149- throw new Error ( "Not loaded userOTokenRate!" ) ;
150- }
151-
152147 if ( ! currentBalance ) {
153- throw new Error ( "Not loaded currentBalance!" ) ;
148+ alert ( "Not loaded currentBalance, please wait a moment and try again." ) ;
149+ throw new Error ( "Not loaded currentBalance." ) ;
154150 }
155151
156152 let quantity = new Quantity ( 0n , currentBalance ?. denomination ) . fromString (
You can’t perform that action at this time.
0 commit comments