Maintain some feed data to avoid needless glimmers (#2054)
This commit is contained in:
parent
9fa90bb8d9
commit
826cbbd4bf
11 changed files with 40 additions and 23 deletions
|
|
@ -14,6 +14,7 @@ import {isNative} from '#/platform/detection'
|
|||
import {useMutedThreads} from '#/state/muted-threads'
|
||||
import {RQKEY as RQKEY_NOTIFS} from './feed'
|
||||
import {logger} from '#/logger'
|
||||
import {truncateAndInvalidate} from '../util'
|
||||
|
||||
const UPDATE_INTERVAL = 30 * 1e3 // 30sec
|
||||
|
||||
|
|
@ -126,7 +127,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||
// update & broadcast
|
||||
setNumUnread(unreadCountStr)
|
||||
if (invalidate) {
|
||||
queryClient.resetQueries({queryKey: RQKEY_NOTIFS()})
|
||||
truncateAndInvalidate(queryClient, RQKEY_NOTIFS())
|
||||
}
|
||||
broadcast.postMessage({event: unreadCountStr})
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue