Skip to content

Commit cd024e4

Browse files
committed
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>
1 parent 4fc8ec3 commit cd024e4

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

apps/mobile/src/modules/entry-content/EntryGridFooter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { FeedIcon } from "@/src/components/ui/icon/feed-icon"
99
import { gentleSpringPreset } from "@/src/constants/spring"
1010
import { useEntry } from "@/src/store/entry/hooks"
1111
import { useFeed } from "@/src/store/feed/hooks"
12-
import { useEntryTranslation, usePrefetchEntryTranslation } from "@/src/store/translation/hooks"
12+
import { useEntryTranslation } from "@/src/store/translation/hooks"
1313

1414
import { useEntryListContextView } from "../entry-list/EntryListContext"
1515
import { EntryTranslation } from "../entry-list/templates/EntryTranslation"
@@ -22,7 +22,7 @@ export const EntryGridFooter = ({
2222
descriptionClassName?: string
2323
}) => {
2424
const entry = useEntry(entryId)
25-
usePrefetchEntryTranslation(entryId)
25+
2626
const translation = useEntryTranslation(entryId)
2727
const feed = useFeed(entry?.feedId || "")
2828
const view = useEntryListContextView()

apps/mobile/src/modules/entry-list/templates/EntryNormalItem.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { EntryDetailScreen } from "@/src/screens/(stack)/entries/[entryId]"
2424
import { useEntry } from "@/src/store/entry/hooks"
2525
import { getInboxFrom } from "@/src/store/entry/utils"
2626
import { useFeed } from "@/src/store/feed/hooks"
27-
import { useEntryTranslation, usePrefetchEntryTranslation } from "@/src/store/translation/hooks"
27+
import { useEntryTranslation } from "@/src/store/translation/hooks"
2828

2929
import { EntryItemContextMenu } from "../../context-menu/entry"
3030
import { EntryItemSkeleton } from "../EntryListContentArticle"
@@ -33,7 +33,6 @@ import { EntryTranslation } from "./EntryTranslation"
3333

3434
export function EntryNormalItem({ entryId, extraData }: { entryId: string; extraData: string }) {
3535
const entry = useEntry(entryId)
36-
usePrefetchEntryTranslation(entryId)
3736
const translation = useEntryTranslation(entryId)
3837
const from = getInboxFrom(entry)
3938
const feed = useFeed(entry?.feedId as string)

apps/mobile/src/modules/entry-list/templates/EntrySocialItem.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { EntryDetailScreen } from "@/src/screens/(stack)/entries/[entryId]"
1919
import { FeedScreen } from "@/src/screens/(stack)/feeds/[feedId]"
2020
import { useEntry } from "@/src/store/entry/hooks"
2121
import { useFeed } from "@/src/store/feed/hooks"
22-
import { useEntryTranslation, usePrefetchEntryTranslation } from "@/src/store/translation/hooks"
22+
import { useEntryTranslation } from "@/src/store/translation/hooks"
2323
import { unreadSyncService } from "@/src/store/unread/store"
2424

2525
import { EntryItemContextMenu } from "../../context-menu/entry"
@@ -28,7 +28,6 @@ import { EntryTranslation } from "./EntryTranslation"
2828

2929
export function EntrySocialItem({ entryId }: { entryId: string }) {
3030
const entry = useEntry(entryId)
31-
usePrefetchEntryTranslation(entryId)
3231
const translation = useEntryTranslation(entryId)
3332

3433
const feed = useFeed(entry?.feedId || "")

0 commit comments

Comments
 (0)