diff options
author | Jaz <ericvolp12@gmail.com> | 2023-05-17 21:19:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 21:19:20 -0700 |
commit | 7f76c2d67e62ba2d10e8b17673a7bbcf7248564f (patch) | |
tree | ece7f72b04ee4bb39d4118b0b520683deddaa972 /src/lib/hooks/useUnreadCountLabel.ts | |
parent | ac3a95dc7228ad3d1d1cb7c5e7e26968009173bb (diff) | |
parent | 0ca096138a690f036828c49f9e95cf394b1a4339 (diff) | |
download | voidsky-7f76c2d67e62ba2d10e8b17673a7bbcf7248564f.tar.zst |
Merge branch 'main' into inherit_system_theme
Diffstat (limited to 'src/lib/hooks/useUnreadCountLabel.ts')
-rw-r--r-- | src/lib/hooks/useUnreadCountLabel.ts | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/lib/hooks/useUnreadCountLabel.ts b/src/lib/hooks/useUnreadCountLabel.ts deleted file mode 100644 index e2bf77885..000000000 --- a/src/lib/hooks/useUnreadCountLabel.ts +++ /dev/null @@ -1,19 +0,0 @@ -import {useEffect, useReducer} from 'react' -import {DeviceEventEmitter} from 'react-native' -import {useStores} from 'state/index' - -export function useUnreadCountLabel() { - // HACK: We don't have anything like Redux selectors, - // and we don't want to use <RootStoreContext.Consumer /> - // to react to the whole store - const [, forceUpdate] = useReducer(x => x + 1, 0) - useEffect(() => { - const subscription = DeviceEventEmitter.addListener( - 'unread-notifications', - forceUpdate, - ) - return () => subscription?.remove() - }, [forceUpdate]) - - return useStores().me.notifications.unreadCountLabel -} |