Skip to content

Commit 12b5cdf

Browse files
committed
fix: negative value bug fix
1 parent 9932dd7 commit 12b5cdf

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pages/country/_country.vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,15 @@ export default {
354354
let countryNewCasesTrendDeath = []
355355
356356
countryNewCasesTrendRaw.forEach(country => {
357-
countryNewCasesTrendConfirmed.push(country["new_infections"])
358-
countryNewCasesTrendRecovered.push(country["new_recovered"])
359-
countryNewCasesTrendDeath.push(country["new_deaths"])
357+
countryNewCasesTrendConfirmed.push(
358+
country["new_infections"] > 0 ? country["new_infections"] : 0
359+
)
360+
countryNewCasesTrendRecovered.push(
361+
country["new_recovered"] > 0 ? country["new_recovered"] : 0
362+
)
363+
countryNewCasesTrendDeath.push(
364+
country["new_deaths"] > 0 ? country["new_deaths"] : 0
365+
)
360366
this.countryNewCasesTrend.newCasesTrendDates.push(
361367
country["last_updated"].slice(0, 10)
362368
)

0 commit comments

Comments
 (0)