From 81a5186fd0ec4e20d8b14e44507bcae701dd0b06 Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 20 May 2025 01:00:30 +0800 Subject: [PATCH] fix: disable fetch reading history in inbox entry Signed-off-by: Innei --- .../entry-content/components/EntryReadHistory.electron.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryReadHistory.electron.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryReadHistory.electron.tsx index c72e1e515..5bbd622f5 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryReadHistory.electron.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/components/EntryReadHistory.electron.tsx @@ -2,7 +2,7 @@ import { AvatarGroup } from "@follow/components/ui/avatar-group/index.js" import { FeedViewType } from "@follow/constants" import { useWhoami } from "~/atoms/user" -import { getRouteParams } from "~/hooks/biz/useRouteParams" +import { getRouteParams, useRouteParamsSelector } from "~/hooks/biz/useRouteParams" import { useAuthQuery } from "~/hooks/common" import { useAppLayoutGridContainerWidth } from "~/providers/app-grid-layout-container-provider" import { Queries } from "~/queries" @@ -32,8 +32,12 @@ export const EntryReadHistory: Component<{ entryId: string }> = ({ entryId }) => const me = useWhoami() const entryHistory = useEntryReadHistory(entryId) + const inboxId = useRouteParamsSelector((s) => s.inboxId) + const { data } = useAuthQuery(Queries.entries.entryReadingHistory(entryId), { refetchInterval: 1000 * 60, + enabled: !inboxId, + refetchIntervalInBackground: false, }) const totalCount = data?.total || 0