fix: prefetch subscription at top level
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
+2
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user