From dfa994ee8d5888cb2fbca177dac9844b9b8704db Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Fri, 8 Sep 2023 19:35:38 +0530 Subject: [PATCH] chore: fix initial value for count bubble --- .../Components/NavigationMenu/NavigationMenu.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/web/src/javascripts/Components/NavigationMenu/NavigationMenu.tsx b/packages/web/src/javascripts/Components/NavigationMenu/NavigationMenu.tsx index a9bebdebc..304d9397f 100644 --- a/packages/web/src/javascripts/Components/NavigationMenu/NavigationMenu.tsx +++ b/packages/web/src/javascripts/Components/NavigationMenu/NavigationMenu.tsx @@ -12,9 +12,11 @@ export const NavigationMenuButton = () => { const { setPaneLayout } = useResponsiveAppPane() const { isTabletOrMobile, isMobile } = useIsTabletOrMobileScreen() - const [bubbleCount, setBubbleCount] = useState(() => - application.status.totalPreferencesBubbleCount.toString(), - ) + const [bubbleCount, setBubbleCount] = useState(() => { + return application.status.totalPreferencesBubbleCount + ? application.status.totalPreferencesBubbleCount.toString() + : undefined + }) useEffect(() => { return application.status.addEventObserver((event, message) => { if (event !== StatusServiceEvent.PreferencesBubbleCountChanged) {