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 @@ -55,24 +55,28 @@ export const useBurn = (onMutate = () => {}) => {
5555 to : activeVault . owner ,
5656 } ) ;
5757 const needsAllowance = allowance < amount ;
58-
59- setModalState ( { step : SubmitStepEnum . confirming } ) ;
60-
6158 if ( needsAllowance ) {
59+ setModalState ( { step : SubmitStepEnum . confirming } ) ;
60+
6261 const receipt = await tokenContract . approve ( {
6362 amount : maxUint256 ,
6463 to : activeVault . owner ,
64+ callback : async ( props ) => {
65+ if ( props . stage === 'receipt' ) {
66+ setModalState ( {
67+ step : SubmitStepEnum . submitting ,
68+ tx : receipt . hash ,
69+ } ) ;
70+ }
71+ } ,
6572 } ) ;
6673
67- setModalState ( { step : SubmitStepEnum . submitting , tx : receipt . hash } ) ;
68-
6974 await publicClient . waitForTransactionReceipt ( {
7075 hash : receipt . hash ,
7176 } ) ;
7277 }
7378
7479 setModalState ( { step : SubmitStepEnum . confirming } ) ;
75-
7680 const tx = await writeContractAsync ( {
7781 abi : dashboardAbi ,
7882 address : activeVault . owner ,
You can’t perform that action at this time.
0 commit comments