fix: balance displaying NaN (#5024)

* convert string to num

* another potentional string addition

* remove return statement

* fix formatting
This commit is contained in:
Truman Gao
2026-01-01 16:27:53 -08:00
committed by GitHub
parent 9bb012a439
commit 477d77cdc1

View File

@@ -440,7 +440,7 @@ const processingDate = computed<{ date: string; amount: number }>(() => {
})
const grandTotal = computed(() =>
userBalance.value ? userBalance.value.available + userBalance.value.pending : 0,
userBalance.value ? Number(userBalance.value.available) + Number(userBalance.value.pending) : 0,
)
const hasTinMismatch = computed(() => {
@@ -508,7 +508,7 @@ const segments = computed<RevenueBarSegment[]>(() => {
const upcoming = processing.date ? dates.filter((d) => d.date !== processing.date) : dates
const totalPending = userBalance.value?.pending ?? 0
const total = available + totalPending
const total = Number(available) + Number(totalPending)
if (total <= 0) return [] as RevenueBarSegment[]