From 566cb9a744c4f67ad5a38f1edc95e3d918da1fc4 Mon Sep 17 00:00:00 2001
From: Bastien Dumont <bdumont@grandlyon.com>
Date: Tue, 16 Jan 2024 09:11:05 +0100
Subject: [PATCH] fix(popup): show new date instead of expired

---
 src/components/Popups/Popups.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/components/Popups/Popups.tsx b/src/components/Popups/Popups.tsx
index 4fff30d9..426ee34f 100644
--- a/src/components/Popups/Popups.tsx
+++ b/src/components/Popups/Popups.tsx
@@ -154,7 +154,9 @@ const Popups: React.FC = () => {
             endDate: customPopup.endDate,
             popupEnabled: isEnabled,
           })
-          setPreviousEndDate(previousPopup.endDate || undefined)
+          setPreviousEndDate(
+            isOutdated ? customPopup.endDate : previousPopup.endDate
+          )
         }
       }
       setIsLoading(false)
-- 
GitLab