fix: prefetch subscription at top level

This commit is contained in:
Stephen Zhou
2025-07-08 10:53:52 +08:00
parent 2a9f69c26a
commit 5ae697de01
2 changed files with 7 additions and 8 deletions
@@ -4,6 +4,8 @@ import { RootPortal } from "@follow/components/ui/portal/index.js"
import type { FeedViewType } from "@follow/constants"
import { useTypeScriptHappyCallback } from "@follow/hooks"
import { ELECTRON_BUILD } from "@follow/shared/constants"
import { usePrefetchSubscription } from "@follow/store/subscription/hooks"
import { usePrefetchUnread } from "@follow/store/unread/hooks"
import { EventBus } from "@follow/utils/event-bus"
import { clamp, cn } from "@follow/utils/utils"
import { useWheel } from "@use-gesture/react"
@@ -37,6 +39,9 @@ export function SubscriptionColumn({
children,
className,
}: PropsWithChildren<{ className?: string }>) {
usePrefetchSubscription()
usePrefetchUnread()
const carouselRef = useRef<HTMLDivElement>(null)
const timelineList = useTimelineList()
@@ -1,11 +1,8 @@
import type { FeedViewType } from "@follow/constants"
import { views } from "@follow/constants"
import {
useCategoryOpenStateByView,
usePrefetchSubscription,
} from "@follow/store/subscription/hooks"
import { useCategoryOpenStateByView } from "@follow/store/subscription/hooks"
import { subscriptionActions } from "@follow/store/subscription/store"
import { usePrefetchUnread, useUnreadByView } from "@follow/store/unread/hooks"
import { useUnreadByView } from "@follow/store/unread/hooks"
import { stopPropagation } from "@follow/utils"
import { useTranslation } from "react-i18next"
@@ -15,9 +12,6 @@ import { UnreadNumber } from "../UnreadNumber"
import { SortButton } from "./SortButton"
export const ListHeader = ({ view }: { view: FeedViewType }) => {
usePrefetchSubscription()
usePrefetchUnread()
const { t } = useTranslation()
const categoryOpenStateData = useCategoryOpenStateByView(view)
const expansion = Object.values(categoryOpenStateData).every((value) => value === true)