Skip to content

Commit

Permalink
fix(stat): review number of operations calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Ribiere committed Dec 15, 2023
1 parent adef0b4 commit 86ceaff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/classes/PopUpAndStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const updateStats = function (minDate: Date, maxDate: Date, timeFilteredD
let under5 = 0
let nbNationalities = 0
const days = new Set()
const nbRescueOps = store.allData.filter(el => el.typeOps === "Rescue").length
const nbRescueOps = store.allData.map(x => x.nbOps).reduce((acc, currentVal) => acc + currentVal, 0)
const nbPeopleAssisted = store.allData.filter(el => el.nbSurvivor).map(
el => el.nbSurvivor).reduce((partialSum, a) => partialSum + a, 0)
const nationalitiesList = []
Expand All @@ -67,8 +67,8 @@ export const updateStats = function (minDate: Date, maxDate: Date, timeFilteredD
pregnantwomen = data.pregnantWomen ? pregnantwomen + data.pregnantWomen : pregnantwomen
under18unacc = data.under18unacc ? under18unacc + data.under18unacc : under18unacc
under5 = data.under5 ? under5 + data.under5 : under5
// nbRescueOps += data.nbOps
if (data.nbNationalities) nationalitiesList.push(data.nbNationalities.split(";"))
// nbNationalities = data.nbNationalities ? Math.max(nbNationalities, data.nbNationalities) : nbNationalities
days.add(data.date)
}
nbNationalities = [...new Set(nationalitiesList.flat())].length
Expand Down

0 comments on commit 86ceaff

Please sign in to comment.