Skip to content

Commit

Permalink
chore: disable refetch unread when focus
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 24, 2024
1 parent 6a63e20 commit 6744796
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/renderer/src/modules/feed-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,17 @@ const useBackHome = (active: number) => {
}

const useUnreadByView = () => {
useAuthQuery(Queries.subscription.byView())
useAuthQuery(Queries.subscription.byView(), {
refetchOnWindowFocus: false,
refetchInterval: false,
})
const idByView = useSubscriptionStore((state) => state.feedIdByView)
const totalUnread = useFeedUnreadStore((state) => {
const unread = {} as Record<number, number>

for (const view in idByView) {
unread[view] = idByView[view].reduce(
(acc, feedId) => acc + (state.data[feedId] || 0),
(acc: number, feedId: string) => acc + (state.data[feedId] || 0),
0,
)
}
Expand Down

0 comments on commit 6744796

Please sign in to comment.