diff --git a/web/push-notif/badge-handler.react.js b/web/push-notif/badge-handler.react.js --- a/web/push-notif/badge-handler.react.js +++ b/web/push-notif/badge-handler.react.js @@ -1,15 +1,16 @@ // @flow import * as React from 'react'; -import { useSelector } from 'react-redux'; +import { connectionSelector } from 'lib/selectors/keyserver-selectors.js'; import { unreadCount } from 'lib/selectors/thread-selectors.js'; import electron from '../electron.js'; +import { useSelector } from '../redux/redux-utils.js'; import getTitle from '../title/getTitle.js'; function useBadgeHandler() { - const connection = useSelector(state => state.connection); + const connection = useSelector(connectionSelector); const prevConnection = React.useRef(); const boundUnreadCount = useSelector(unreadCount); @@ -17,7 +18,7 @@ React.useEffect(() => { if ( - connection.status === 'connected' && + connection?.status === 'connected' && (prevConnection.current?.status !== 'connected' || boundUnreadCount !== prevUnreadCount.current) ) {