about summary refs log tree commit diff
path: root/src/lib/hooks/useUnreadCountLabel.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/hooks/useUnreadCountLabel.ts')
-rw-r--r--src/lib/hooks/useUnreadCountLabel.ts19
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
-}