chore: fix initial value for count bubble

This commit is contained in:
Aman Harwara
2023-09-08 19:35:38 +05:30
parent 126e9abd9c
commit dfa994ee8d

View File

@@ -12,9 +12,11 @@ export const NavigationMenuButton = () => {
const { setPaneLayout } = useResponsiveAppPane()
const { isTabletOrMobile, isMobile } = useIsTabletOrMobileScreen()
const [bubbleCount, setBubbleCount] = useState<string | undefined>(() =>
application.status.totalPreferencesBubbleCount.toString(),
)
const [bubbleCount, setBubbleCount] = useState<string | undefined>(() => {
return application.status.totalPreferencesBubbleCount
? application.status.totalPreferencesBubbleCount.toString()
: undefined
})
useEffect(() => {
return application.status.addEventObserver((event, message) => {
if (event !== StatusServiceEvent.PreferencesBubbleCountChanged) {