File tree Expand file tree Collapse file tree
features/adjustment/repay/hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,22 +58,19 @@ export const useBurn = (onMutate = () => {}) => {
5858 if ( needsAllowance ) {
5959 setModalState ( { step : SubmitStepEnum . confirming } ) ;
6060
61- const receipt = await tokenContract . approve ( {
61+ const result = await tokenContract . approve ( {
6262 amount : maxUint256 ,
6363 to : activeVault . owner ,
6464 callback : async ( props ) => {
6565 if ( props . stage === 'receipt' ) {
66- setModalState ( {
67- step : SubmitStepEnum . submitting ,
68- tx : receipt . hash ,
69- } ) ;
66+ setModalState ( { step : SubmitStepEnum . submitting } ) ;
7067 }
7168 } ,
7269 } ) ;
7370
74- await publicClient . waitForTransactionReceipt ( {
75- hash : receipt . hash ,
76- } ) ;
71+ if ( result . receipt ?. status === 'reverted' ) {
72+ throw new Error ( 'Transaction was reverted' ) ;
73+ }
7774 }
7875
7976 setModalState ( { step : SubmitStepEnum . confirming } ) ;
You can’t perform that action at this time.
0 commit comments