From ec2a0bb3ac72f76accea008399b5fedc42208cda Mon Sep 17 00:00:00 2001
From: Simon Malesys <simon.malesys@pasteur.fr>
Date: Tue, 22 Apr 2025 14:43:26 +0200
Subject: [PATCH] Fetch the stats when the stats page is mounted

---
 src/client/components/TheStatisticsPage.vue | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/client/components/TheStatisticsPage.vue b/src/client/components/TheStatisticsPage.vue
index 2a6f882..85fb80f 100644
--- a/src/client/components/TheStatisticsPage.vue
+++ b/src/client/components/TheStatisticsPage.vue
@@ -113,7 +113,11 @@ const plotConfig = {
   responsive: true
 }
 
-onMounted(() => {
+onMounted(async () => {
+  if (!statistics.value) {
+    await store.getStatistics()
+  }
+
   buildSpeciesPlot()
   buildSourcesPlot()
   buildHeavySegmentsPlot()
-- 
GitLab