@huma-finance/widgets 0.0.72 → 0.0.73-beta.910
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 +12 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/Lend/solanaWithdraw/index.tsx +12 -2
package/dist/index.js
CHANGED
|
@@ -7300,6 +7300,16 @@ function SolanaLendWithdraw(_ref) {
|
|
|
7300
7300
|
} = lenderStateAccount.redemptionRecord;
|
|
7301
7301
|
const withdrawableAmount = totalAmountProcessed.sub(totalAmountWithdrawn);
|
|
7302
7302
|
const withdrawableAmountFormatted = formatNumberFixed(SolanaTokenUtils.formatUnits(withdrawableAmount, decimals), 2);
|
|
7303
|
+
const [withdrawnAmount, setWithdrawnAmount] = useState();
|
|
7304
|
+
|
|
7305
|
+
// After withdrawn success, the handleSuccess will refresh
|
|
7306
|
+
// the lenderStateAccount which will update the withdrawableAmount to 0
|
|
7307
|
+
// so we need to keep the withdrawnAmount to show in the Done step
|
|
7308
|
+
useEffect(() => {
|
|
7309
|
+
if (!withdrawnAmount) {
|
|
7310
|
+
setWithdrawnAmount(withdrawableAmount);
|
|
7311
|
+
}
|
|
7312
|
+
}, [withdrawableAmount, withdrawnAmount]);
|
|
7303
7313
|
useEffect(() => {
|
|
7304
7314
|
if (!step) {
|
|
7305
7315
|
dispatch(setStep(WIDGET_STEP.ConfirmTransfer));
|
|
@@ -7331,9 +7341,9 @@ function SolanaLendWithdraw(_ref) {
|
|
|
7331
7341
|
poolInfo: poolInfo,
|
|
7332
7342
|
selectedTranche: trancheType,
|
|
7333
7343
|
poolIsClosed: poolIsClosed
|
|
7334
|
-
}), step === WIDGET_STEP.Done && jsx(Done$1, {
|
|
7344
|
+
}), step === WIDGET_STEP.Done && withdrawnAmount && jsx(Done$1, {
|
|
7335
7345
|
poolUnderlyingToken: poolInfo.underlyingMint,
|
|
7336
|
-
withdrawAmount:
|
|
7346
|
+
withdrawAmount: withdrawnAmount,
|
|
7337
7347
|
handleAction: handleClose
|
|
7338
7348
|
}), step === WIDGET_STEP.Error && jsx(ErrorModal, {
|
|
7339
7349
|
title: title,
|