Skip to content

Commit

Permalink
feat(frontend): filter out bogus data
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkrist committed Oct 20, 2022
1 parent d14b7bd commit 3c9c855
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ const replication = db.replicate.from(
)

const getDocs = (docs, { areacode, dateFrom, dateTo, forecast }) => {
docs = docs.filter(d => !d.forecast && d.areacode === areacode)
docs = docs.filter(d => !d.forecast && d.areacode === areacode).reduce(
(acc, d, i, arr) => d.infected === arr[i + 1]?.infected ? acc : [...acc, d],
[]
)

if (dateFrom) {
const date = new Date(dateFrom)
Expand Down

0 comments on commit 3c9c855

Please sign in to comment.