Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/neuron-ui/src/components/NervosDAO/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,14 @@ const NervosDAO = () => {
}, [])

useEffect(() => {
if (BigInt(CKBToShannonFormatter(depositValue)) > maxDepositAmount) {
setDepositValue(shannonToCKBFormatter(`${maxDepositAmount}`, false, ''))
try {
if (BigInt(CKBToShannonFormatter(depositValue)) > maxDepositAmount) {
setDepositValue(shannonToCKBFormatter(`${maxDepositAmount}`, false, ''))
}
} catch (error) {
// ignore error
Comment thread
yanguoyu marked this conversation as resolved.
// When the depositValue is invalid, it displays the error in the textField, but it will throw an exception when valid wheater it's big than the max deposit value
// and when the depositValue is invalid, it's no need to set max depositValue.
}
}, [maxDepositAmount, depositValue, setDepositValue])

Expand Down