style: remove useUnreadCountLabel hack from 50c1841 (#655) (#686)

I just realized how `mobx` works (never used before lol) and now I feel
dumb.
This commit is contained in:
LW
2023-05-17 07:50:28 -07:00
committed by GitHub
parent 656baa7239
commit 41f3a05515
3 changed files with 9 additions and 25 deletions
+6 -2
View File
@@ -3,11 +3,15 @@ import {useNavigation} from '@react-navigation/native'
import {NavigationProp} from 'lib/routes/types'
import {bskyTitle} from 'lib/strings/headings'
import {useUnreadCountLabel} from './useUnreadCountLabel'
import {useStores} from 'state/index'
/**
* Requires consuming component to be wrapped in `observer`:
* https://stackoverflow.com/a/71488009
*/
export function useSetTitle(title?: string) {
const navigation = useNavigation<NavigationProp>()
const unreadCountLabel = useUnreadCountLabel()
const {unreadCountLabel} = useStores().me.notifications
useEffect(() => {
if (title) {
navigation.setOptions({title: bskyTitle(title, unreadCountLabel)})