Skip to content

Commit

Permalink
fix: Allow to display HighlightAlert at first launch
Browse files Browse the repository at this point in the history
If we want to display an HighlightAlert at first launch,
APP_START_COUNT_KEY is NaN.

NaN ?? 0 => NaN
NaN || 0 => 0
  • Loading branch information
zatteo committed Oct 24, 2023
1 parent dbbdb34 commit 9207b89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9207b89

Please sign in to comment.