diff --git a/dashboard/src/recoil/selectors.js b/dashboard/src/recoil/selectors.js index ee5d87143..5f8634faf 100644 --- a/dashboard/src/recoil/selectors.js +++ b/dashboard/src/recoil/selectors.js @@ -108,6 +108,10 @@ export const itemsGroupedByPersonSelector = selector({ formattedPhoneNumber: person.phone?.replace(/\D/g, ''), interactions: [person.followedSince || person.createdAt], lastUpdateCheckForGDPR: person.followedSince || person.createdAt, + // BUG FIX: we used to set an `outOfActiveListDate` even if `outOfActiveList` was false. + // https://github.com/SocialGouv/mano/blob/34a86a3e6900b852e0b3fe828a03e6721d200973/dashboard/src/scenes/person/OutOfActiveList.js#L22 + // This was causing a bug in the "person suivies" stats, where people who were not out of active list were counted as out of active list. + outOfActiveListDate: person.outOfActiveList ? person.outOfActiveListDate : null, }; if (!person.history?.length) continue; for (const historyEntry of person.history) { diff --git a/dashboard/src/scenes/person/view.js b/dashboard/src/scenes/person/view.js index 145515fca..208dda47f 100644 --- a/dashboard/src/scenes/person/view.js +++ b/dashboard/src/scenes/person/view.js @@ -39,7 +39,6 @@ export default function View() { const preparePersonForEncryption = usePreparePersonForEncryption(); if (!person) { - toast.error("Cette personne n'existe pas, ou vient d'ĂȘtre supprimĂ©e par un(e) autre utilisateur(rice) de votre organisation"); history.push('/person'); return null; }