Skip to content

Commit

Permalink
šŸ›Fix amount handling in AddNewStrategyButton and update initial deposā€¦
Browse files Browse the repository at this point in the history
ā€¦it display in DeployVault
  • Loading branch information
MattPoblete committed Nov 19, 2024
1 parent 26c188f commit cb98c0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/dapp/src/components/DeployVault/AddNewStrategyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ function AddNewStrategyButton() {
symbol: selectedAsset.symbol
}
if (strategyExists(selectedAsset.strategies[0]!)) {
if (amountInput.enabled && amountInput.amount! > 0) {
await dispatch(setAmountByAddress({ address: selectedAsset.address, amount: amountInput.amount }))
} else if (amountInput.enabled == false || amountInput.amount! == 0) {
await dispatch(setAmountByAddress({ address: selectedAsset.address, amount: 0 }))
}
}
await dispatch(pushAsset(newAsset))
if (amountInput.enabled && amountInput.amount! > 0) {
Expand Down
2 changes: 1 addition & 1 deletion apps/dapp/src/components/DeployVault/DeployVault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const DeployVault = () => {
Strategy Address: {shortenAddress(strategy.address)}
</li>
</Tooltip>
{amounts[j] && <li>Initial deposit: ${amounts[j]} {asset.symbol}</li>}
{(amounts[j]! > 0) && <li>Initial deposit: ${amounts[j]} {asset.symbol}</li>}
</Box>
)}
</For>
Expand Down

0 comments on commit cb98c0c

Please sign in to comment.