update the number correctly
This commit is contained in:
@@ -11,6 +11,7 @@ import BroadcastChannel from '#/lib/broadcast'
|
|||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useMutedThreads} from '#/state/muted-threads'
|
import {useMutedThreads} from '#/state/muted-threads'
|
||||||
import {useAgent, useSession} from '#/state/session'
|
import {useAgent, useSession} from '#/state/session'
|
||||||
|
import {decrementBadgeCount} from 'lib/notifications/notifications'
|
||||||
import {useModerationOpts} from '../../preferences/moderation-opts'
|
import {useModerationOpts} from '../../preferences/moderation-opts'
|
||||||
import {truncateAndInvalidate} from '../util'
|
import {truncateAndInvalidate} from '../util'
|
||||||
import {RQKEY as RQKEY_NOTIFS} from './feed'
|
import {RQKEY as RQKEY_NOTIFS} from './feed'
|
||||||
@@ -118,6 +119,12 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
// update & broadcast
|
// update & broadcast
|
||||||
setNumUnread('')
|
setNumUnread('')
|
||||||
broadcast.postMessage({event: ''})
|
broadcast.postMessage({event: ''})
|
||||||
|
|
||||||
|
if (cacheRef.current.unreadCount >= 30) {
|
||||||
|
decrementBadgeCount(30)
|
||||||
|
} else {
|
||||||
|
decrementBadgeCount(cacheRef.current.unreadCount)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async checkUnread({
|
async checkUnread({
|
||||||
|
|||||||
Reference in New Issue
Block a user