diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-30 18:49:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 18:49:23 -0800 |
commit | 826cbbd4bf3a9a3cfb87b6dedee630e915b07b27 (patch) | |
tree | 36bdc8edbe3fafc2b1ce780f5a70788eaf97524f /src/state/queries/notifications/unread.tsx | |
parent | 9fa90bb8d97db5078aedaa359d4b956d67e31ada (diff) | |
download | voidsky-826cbbd4bf3a9a3cfb87b6dedee630e915b07b27.tar.zst |
Maintain some feed data to avoid needless glimmers (#2054)
Diffstat (limited to 'src/state/queries/notifications/unread.tsx')
-rw-r--r-- | src/state/queries/notifications/unread.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/state/queries/notifications/unread.tsx b/src/state/queries/notifications/unread.tsx index e0510e79e..6c130aaea 100644 --- a/src/state/queries/notifications/unread.tsx +++ b/src/state/queries/notifications/unread.tsx @@ -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) { |