@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.
@@ -7317,6 +7317,16 @@ function SolanaLendWithdraw(_ref) {
7317
7317
  } = lenderStateAccount.redemptionRecord;
7318
7318
  const withdrawableAmount = totalAmountProcessed.sub(totalAmountWithdrawn);
7319
7319
  const withdrawableAmountFormatted = shared.formatNumberFixed(shared.SolanaTokenUtils.formatUnits(withdrawableAmount, decimals), 2);
7320
+ const [withdrawnAmount, setWithdrawnAmount] = React.useState();
7321
+
7322
+ // After withdrawn success, the handleSuccess will refresh
7323
+ // the lenderStateAccount which will update the withdrawableAmount to 0
7324
+ // so we need to keep the withdrawnAmount to show in the Done step
7325
+ React.useEffect(() => {
7326
+ if (!withdrawnAmount) {
7327
+ setWithdrawnAmount(withdrawableAmount);
7328
+ }
7329
+ }, [withdrawableAmount, withdrawnAmount]);
7320
7330
  React.useEffect(() => {
7321
7331
  if (!step) {
7322
7332
  dispatch(setStep(WIDGET_STEP.ConfirmTransfer));
@@ -7348,9 +7358,9 @@ function SolanaLendWithdraw(_ref) {
7348
7358
  poolInfo: poolInfo,
7349
7359
  selectedTranche: trancheType,
7350
7360
  poolIsClosed: poolIsClosed
7351
- }), step === WIDGET_STEP.Done && jsxRuntime.jsx(Done$1, {
7361
+ }), step === WIDGET_STEP.Done && withdrawnAmount && jsxRuntime.jsx(Done$1, {
7352
7362
  poolUnderlyingToken: poolInfo.underlyingMint,
7353
- withdrawAmount: withdrawableAmount,
7363
+ withdrawAmount: withdrawnAmount,
7354
7364
  handleAction: handleClose
7355
7365
  }), step === WIDGET_STEP.Error && jsxRuntime.jsx(ErrorModal, {
7356
7366
  title: title,