From e0b267dc0215cce88cec2800b889ba43338bae78 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Mon, 4 Mar 2024 11:30:38 +0100 Subject: [PATCH] fix: satisfaction in stats --- site/source/pages/statistiques/StatsPage.tsx | 2 +- .../pages/statistiques/_components/LastMonthIndicators.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/site/source/pages/statistiques/StatsPage.tsx b/site/source/pages/statistiques/StatsPage.tsx index 2af009eac..ff40a1473 100644 --- a/site/source/pages/statistiques/StatsPage.tsx +++ b/site/source/pages/statistiques/StatsPage.tsx @@ -118,7 +118,7 @@ export default function StatPage({ stats }: StatsDetailProps) { {!!satisfaction.length && // We only display the satisfaction chart if the last month's number of reviews is greater than 100 - (satisfaction.at(-1)?.total ?? 0) >= 100 && ( + (satisfaction.at(-2)?.total ?? 0) >= 100 && ( <>

Satisfaction

diff --git a/site/source/pages/statistiques/_components/LastMonthIndicators.tsx b/site/source/pages/statistiques/_components/LastMonthIndicators.tsx index 3953506e2..992150b90 100644 --- a/site/source/pages/statistiques/_components/LastMonthIndicators.tsx +++ b/site/source/pages/statistiques/_components/LastMonthIndicators.tsx @@ -38,7 +38,7 @@ export function MainIndicators({ lastMonth.nombre.questions_répondues, language ) - const satisfactionLastMonth = satisfaction.at(-1) + const satisfactionLastMonth = satisfaction.at(-2) || satisfaction.at(-1) return ( <>