From 9207b896f90690163276f42fe177494004461d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Mon, 23 Oct 2023 12:15:41 +0200 Subject: [PATCH] fix: Allow to display HighlightAlert at first launch If we want to display an HighlightAlert at first launch, APP_START_COUNT_KEY is NaN. NaN ?? 0 => NaN NaN || 0 => 0 --- src/components/AppHighlightAlert/BackupAppHighlightAlert.jsx | 2 +- .../AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/AppHighlightAlert/BackupAppHighlightAlert.jsx b/src/components/AppHighlightAlert/BackupAppHighlightAlert.jsx index cee6cb4513..e30c22d7e5 100644 --- a/src/components/AppHighlightAlert/BackupAppHighlightAlert.jsx +++ b/src/components/AppHighlightAlert/BackupAppHighlightAlert.jsx @@ -21,7 +21,7 @@ const isAvailable = () => { const isDisplayable = () => { const appStartCount = - parseInt(localStorage.getItem(APP_START_COUNT_KEY), 10) ?? 0 + parseInt(localStorage.getItem(APP_START_COUNT_KEY), 10) || 0 return appStartCount >= MAX_COUNT_VALUE - 1 } diff --git a/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx b/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx index 8c9c5b54c4..0e90815276 100644 --- a/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx +++ b/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx @@ -26,7 +26,7 @@ const isAvailable = () => { const isDisplayable = () => { const appStartCount = - parseInt(localStorage.getItem(APP_START_COUNT_KEY), 10) ?? 0 + parseInt(localStorage.getItem(APP_START_COUNT_KEY), 10) || 0 return appStartCount >= flag('home.push.coachco2.opencount') - 1 }