Skip to content

Commit

Permalink
fix(neuron-ui): fix the free and locked value of nervos dao
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Nov 12, 2019
1 parent 3d7953a commit 16b2233
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/neuron-ui/src/components/NervosDAO/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,8 @@ const NervosDAO = ({
)
}, [records, withdrawList, t, onActionClick, tipBlockNumber, epoch])

let free = BigInt(0)
let locked = BigInt(0)
records.forEach(r => {
if (!r.depositOutPoint) {
locked += BigInt(r.capacity)
} else {
free += BigInt(r.capacity)
}
})
const free = BigInt(wallet.balance)
const locked = withdrawList.reduce((acc, w) => acc + BigInt(w || 0), BigInt(0))

const EpochInfo = useMemo(() => {
if (!epoch) {
Expand Down

0 comments on commit 16b2233

Please sign in to comment.