@huma-finance/widgets 0.0.72-beta.883 → 0.0.72-beta.886
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +23 -12
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.js +24 -13
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/Lend/components/ApproveLenderBase.tsx +30 -23
package/dist/cjs/index.cjs
CHANGED
|
@@ -6526,27 +6526,38 @@ function ApproveLenderBase(_ref) {
|
|
|
6526
6526
|
tryAttempts = 0;
|
|
6527
6527
|
} catch (e) {
|
|
6528
6528
|
if (tryAttempts === 0) {
|
|
6529
|
-
|
|
6530
|
-
errorMessage: 'Something went wrong, please try again later.'
|
|
6531
|
-
}));
|
|
6529
|
+
throw e;
|
|
6532
6530
|
} else {
|
|
6533
6531
|
await shared.timeUtil.sleep(3000);
|
|
6534
6532
|
console.error(e);
|
|
6535
6533
|
}
|
|
6536
6534
|
}
|
|
6537
6535
|
}
|
|
6538
|
-
}, [account, chainId, chainSpecificData,
|
|
6536
|
+
}, [account, chainId, chainSpecificData, documentHash, isDev, networkType]);
|
|
6539
6537
|
React.useEffect(() => {
|
|
6540
6538
|
const approveLenderAsync = async () => {
|
|
6541
6539
|
if (account && chainId) {
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6540
|
+
try {
|
|
6541
|
+
if (isUniTranche) {
|
|
6542
|
+
await approveLender(juniorTrancheVault);
|
|
6543
|
+
changeTranche('junior');
|
|
6544
|
+
dispatch(setStep(WIDGET_STEP.ChooseAmount));
|
|
6545
|
+
} else {
|
|
6546
|
+
await approveLender(juniorTrancheVault);
|
|
6547
|
+
await approveLender(seniorTrancheVault);
|
|
6548
|
+
dispatch(setStep(WIDGET_STEP.ChooseTranche));
|
|
6549
|
+
}
|
|
6550
|
+
} catch (e) {
|
|
6551
|
+
var _e$message;
|
|
6552
|
+
console.error(e);
|
|
6553
|
+
// @ts-ignore
|
|
6554
|
+
let errorMessage = (_e$message = e.message) !== null && _e$message !== void 0 ? _e$message : shared.COMMON_ERROR_MESSAGE;
|
|
6555
|
+
if (errorMessage.indexOf(shared.SOLANA_TRANSACTION_EXPIRED_BLOCKHEIGHT_EXCEEDED_ERROR) >= 0) {
|
|
6556
|
+
errorMessage = "Transaction failed due to blockchain congestion. Please try again.";
|
|
6557
|
+
}
|
|
6558
|
+
dispatch(setError({
|
|
6559
|
+
errorMessage
|
|
6560
|
+
}));
|
|
6550
6561
|
}
|
|
6551
6562
|
}
|
|
6552
6563
|
};
|