diff options
author | Eric Bailey <git@esb.lol> | 2024-07-03 22:13:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-04 04:13:47 +0100 |
commit | 4f02da96c8c2483923fdf52d1ee7cd8f34b15fba (patch) | |
tree | 981775d5260a813079b5c2d1564380069440b193 /src/state/queries/notifications/unread.tsx | |
parent | 0ed99b840d8de13465f010a6434dea50c72b3f62 (diff) | |
download | voidsky-4f02da96c8c2483923fdf52d1ee7cd8f34b15fba.tar.zst |
[D1X] Pull out follow-backs for higher signal (#4719)
* Pull out follow-backs for higher signal * Gate it * Fix early gate check --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'src/state/queries/notifications/unread.tsx')
-rw-r--r-- | src/state/queries/notifications/unread.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/state/queries/notifications/unread.tsx b/src/state/queries/notifications/unread.tsx index 7bb325ea9..b5f7d0d60 100644 --- a/src/state/queries/notifications/unread.tsx +++ b/src/state/queries/notifications/unread.tsx @@ -8,6 +8,7 @@ import {useQueryClient} from '@tanstack/react-query' import EventEmitter from 'eventemitter3' import BroadcastChannel from '#/lib/broadcast' +import {useGate} from '#/lib/statsig/statsig' import {logger} from '#/logger' import {useAgent, useSession} from '#/state/session' import {resetBadgeCount} from 'lib/notifications/notifications' @@ -47,6 +48,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const agent = useAgent() const queryClient = useQueryClient() const moderationOpts = useModerationOpts() + const gate = useGate() const [numUnread, setNumUnread] = React.useState('') @@ -149,6 +151,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { // only fetch subjects when the page is going to be used // in the notifications query, otherwise skip it fetchAdditionalData: !!invalidate, + shouldUngroupFollowBacks: () => gate('ungroup_follow_backs'), }) const unreadCount = countUnread(page) const unreadCountStr = @@ -189,7 +192,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { } }, } - }, [setNumUnread, queryClient, moderationOpts, agent]) + }, [setNumUnread, queryClient, moderationOpts, agent, gate]) checkUnreadRef.current = api.checkUnread return ( |