fix(mobile): remove prefetching of entry translations

- Removed `usePrefetchEntryTranslation` calls from `EntryGridFooter`, `EntryNormalItem`, and `EntrySocialItem` components to optimize performance and reduce unnecessary data fetching.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-04-07 19:38:08 +08:00
parent 4fc8ec3f42
commit cd024e45d3
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
3 changed files with 4 additions and 6 deletions

View File

@ -9,7 +9,7 @@ import { FeedIcon } from "@/src/components/ui/icon/feed-icon"
import { gentleSpringPreset } from "@/src/constants/spring"
import { useEntry } from "@/src/store/entry/hooks"
import { useFeed } from "@/src/store/feed/hooks"
import { useEntryTranslation, usePrefetchEntryTranslation } from "@/src/store/translation/hooks"
import { useEntryTranslation } from "@/src/store/translation/hooks"
import { useEntryListContextView } from "../entry-list/EntryListContext"
import { EntryTranslation } from "../entry-list/templates/EntryTranslation"
@ -22,7 +22,7 @@ export const EntryGridFooter = ({
descriptionClassName?: string
}) => {
const entry = useEntry(entryId)
usePrefetchEntryTranslation(entryId)
const translation = useEntryTranslation(entryId)
const feed = useFeed(entry?.feedId || "")
const view = useEntryListContextView()

View File

@ -24,7 +24,7 @@ import { EntryDetailScreen } from "@/src/screens/(stack)/entries/[entryId]"
import { useEntry } from "@/src/store/entry/hooks"
import { getInboxFrom } from "@/src/store/entry/utils"
import { useFeed } from "@/src/store/feed/hooks"
import { useEntryTranslation, usePrefetchEntryTranslation } from "@/src/store/translation/hooks"
import { useEntryTranslation } from "@/src/store/translation/hooks"
import { EntryItemContextMenu } from "../../context-menu/entry"
import { EntryItemSkeleton } from "../EntryListContentArticle"
@ -33,7 +33,6 @@ import { EntryTranslation } from "./EntryTranslation"
export function EntryNormalItem({ entryId, extraData }: { entryId: string; extraData: string }) {
const entry = useEntry(entryId)
usePrefetchEntryTranslation(entryId)
const translation = useEntryTranslation(entryId)
const from = getInboxFrom(entry)
const feed = useFeed(entry?.feedId as string)

View File

@ -19,7 +19,7 @@ import { EntryDetailScreen } from "@/src/screens/(stack)/entries/[entryId]"
import { FeedScreen } from "@/src/screens/(stack)/feeds/[feedId]"
import { useEntry } from "@/src/store/entry/hooks"
import { useFeed } from "@/src/store/feed/hooks"
import { useEntryTranslation, usePrefetchEntryTranslation } from "@/src/store/translation/hooks"
import { useEntryTranslation } from "@/src/store/translation/hooks"
import { unreadSyncService } from "@/src/store/unread/store"
import { EntryItemContextMenu } from "../../context-menu/entry"
@ -28,7 +28,6 @@ import { EntryTranslation } from "./EntryTranslation"
export function EntrySocialItem({ entryId }: { entryId: string }) {
const entry = useEntry(entryId)
usePrefetchEntryTranslation(entryId)
const translation = useEntryTranslation(entryId)
const feed = useFeed(entry?.feedId || "")