Skip to content

Commit

Permalink
fix: NaN balance (#2129)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomiir authored Apr 8, 2024
1 parent 28f9bf1 commit 7e0a896
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/common/src/utils/TypeUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export interface Balance {
name: string
symbol: string
chainId: string
value: number
value?: number
price: number
quantity: BalanceQuantity
iconUrl: string
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/CoreHelperUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export const CoreHelperUtil = {
calculateBalance(array: Balance[]) {
let sum = 0
for (const item of array) {
sum += item.value
sum += item.value ?? 0
}

return sum
Expand Down

0 comments on commit 7e0a896

Please sign in to comment.