diff options
author | Hailey <me@haileyok.com> | 2024-05-17 16:05:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 16:05:32 -0700 |
commit | d2c81c9d3d6aebae9c73a7567875e0165cfb1f08 (patch) | |
tree | 428f283a80530d71603d2cad87e62d85d20d2bf7 /src/state/queries/messages/list-converations.ts | |
parent | 49314e2d1f20d7471f1d05ce2b118bd030c44aa2 (diff) | |
download | voidsky-d2c81c9d3d6aebae9c73a7567875e0165cfb1f08.tar.zst |
Disable badge incrementing for DMs (#4088)
* disable badge increments for dms * revert decrementing in js for dms * reset badge on read notifications * remove some other code * prevent duplicate notification events
Diffstat (limited to 'src/state/queries/messages/list-converations.ts')
-rw-r--r-- | src/state/queries/messages/list-converations.ts | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/state/queries/messages/list-converations.ts b/src/state/queries/messages/list-converations.ts index 3939ab8e3..8319fdefe 100644 --- a/src/state/queries/messages/list-converations.ts +++ b/src/state/queries/messages/list-converations.ts @@ -15,7 +15,6 @@ import {useCurrentConvoId} from '#/state/messages/current-convo-id' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {DM_SERVICE_HEADERS} from '#/state/queries/messages/const' import {useAgent, useSession} from '#/state/session' -import {decrementBadgeCount} from 'lib/notifications/notifications' export const RQKEY = ['convo-list'] type RQPageParam = string | undefined @@ -135,18 +134,10 @@ export function useOnMarkAsRead() { return useCallback( (chatId: string) => { queryClient.setQueryData(RQKEY, (old: ConvoListQueryData) => { - return optimisticUpdate(chatId, old, convo => { - // We only want to decrement the badge by one no matter the unread count, since we only increment once per - // sender regardless of message count - if (convo.unreadCount > 0) { - decrementBadgeCount(1) - } - - return { - ...convo, - unreadCount: 0, - } - }) + return optimisticUpdate(chatId, old, convo => ({ + ...convo, + unreadCount: 0, + })) }) }, [queryClient], |