@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huma-finance/widgets",
3
- "version": "0.0.72",
3
+ "version": "0.0.73-beta.910+3833017",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,9 +29,9 @@
29
29
  "@ethersproject/experimental": "^5.7.0",
30
30
  "@ethersproject/providers": "^5.6.0",
31
31
  "@ethersproject/units": "^5.6.0",
32
- "@huma-finance/sdk": "^0.0.72",
33
- "@huma-finance/shared": "^0.0.72",
34
- "@huma-finance/web-shared": "^0.0.72",
32
+ "@huma-finance/sdk": "^0.0.73-beta.910+3833017",
33
+ "@huma-finance/shared": "^0.0.73-beta.910+3833017",
34
+ "@huma-finance/web-shared": "^0.0.73-beta.910+3833017",
35
35
  "@mui/x-date-pickers": "^5.0.7",
36
36
  "@notifi-network/notifi-frontend-client": "^1.1.2",
37
37
  "@notifi-network/notifi-react": "^1.1.2",
@@ -201,5 +201,5 @@
201
201
  "optionalDependencies": {
202
202
  "encoding": "^0.1.13"
203
203
  },
204
- "gitHead": "28aa8d9d808a2fecd5ed8da1e99b0bcfc914f3e6"
204
+ "gitHead": "3833017b9facafe8a1e216d211fcfebd32aad8e9"
205
205
  }
@@ -63,6 +63,16 @@ export function SolanaLendWithdraw({
63
63
  SolanaTokenUtils.formatUnits(withdrawableAmount, decimals),
64
64
  2,
65
65
  )
66
+ const [withdrawnAmount, setWithdrawnAmount] = useState<BN>()
67
+
68
+ // After withdrawn success, the handleSuccess will refresh
69
+ // the lenderStateAccount which will update the withdrawableAmount to 0
70
+ // so we need to keep the withdrawnAmount to show in the Done step
71
+ useEffect(() => {
72
+ if (!withdrawnAmount) {
73
+ setWithdrawnAmount(withdrawableAmount)
74
+ }
75
+ }, [withdrawableAmount, withdrawnAmount])
66
76
 
67
77
  useEffect(() => {
68
78
  if (!step) {
@@ -118,10 +128,10 @@ export function SolanaLendWithdraw({
118
128
  poolIsClosed={poolIsClosed}
119
129
  />
120
130
  )}
121
- {step === WIDGET_STEP.Done && (
131
+ {step === WIDGET_STEP.Done && withdrawnAmount && (
122
132
  <Done
123
133
  poolUnderlyingToken={poolInfo.underlyingMint}
124
- withdrawAmount={withdrawableAmount}
134
+ withdrawAmount={withdrawnAmount}
125
135
  handleAction={handleClose}
126
136
  />
127
137
  )}