feat(context): remove feedId from timeline summary context and related functions
This commit is contained in:
parent
61398f72f1
commit
b0fdc29688
|
|
@ -100,7 +100,7 @@ export const useAutoTimelineSummaryShortcut = () => {
|
|||
})
|
||||
const previousContextKeyRef = useRef<string | null>(null)
|
||||
|
||||
const isAllTimeline = isTimelineSummaryAutoContext({ view, feedId, entryId })
|
||||
const isAllTimeline = isTimelineSummaryAutoContext({ view, entryId })
|
||||
|
||||
const defaultShortcut = useMemo(() => {
|
||||
const shortcuts = aiSettings.shortcuts ?? []
|
||||
|
|
|
|||
|
|
@ -1,24 +1,14 @@
|
|||
import { FeedViewType } from "@follow/constants"
|
||||
|
||||
import { ROUTE_ENTRY_PENDING, ROUTE_FEED_PENDING } from "~/constants"
|
||||
import { ROUTE_ENTRY_PENDING } from "~/constants"
|
||||
import type { BizRouteParams } from "~/hooks/biz/useRouteParams"
|
||||
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
|
||||
|
||||
export type TimelineSummaryContextParams = Pick<BizRouteParams, "view" | "entryId" | "feedId">
|
||||
export type TimelineSummaryContextParams = Pick<BizRouteParams, "view" | "entryId">
|
||||
|
||||
export const isTimelineSummaryAutoContext = ({
|
||||
view,
|
||||
feedId,
|
||||
entryId,
|
||||
}: TimelineSummaryContextParams) => {
|
||||
return (
|
||||
view === FeedViewType.All &&
|
||||
(!entryId || entryId === ROUTE_ENTRY_PENDING) &&
|
||||
(!feedId || feedId === ROUTE_FEED_PENDING)
|
||||
)
|
||||
export const isTimelineSummaryAutoContext = ({ view, entryId }: TimelineSummaryContextParams) => {
|
||||
return view === FeedViewType.All && (!entryId || entryId === ROUTE_ENTRY_PENDING)
|
||||
}
|
||||
|
||||
export const useTimelineSummaryAutoContext = () =>
|
||||
useRouteParamsSelector(({ view, feedId, entryId }) =>
|
||||
isTimelineSummaryAutoContext({ view, feedId, entryId }),
|
||||
)
|
||||
useRouteParamsSelector(({ view, entryId }) => isTimelineSummaryAutoContext({ view, entryId }))
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ export function AllItem({ entryId, translation, currentFeedTitle }: UniversalIte
|
|||
</div>
|
||||
<div
|
||||
className={cn(
|
||||
"ml-2 truncate text-[13px]",
|
||||
"ml-4 truncate text-[13px]",
|
||||
"text-text-secondary",
|
||||
isRead && dimRead && "text-text-tertiary",
|
||||
)}
|
||||
|
|
|
|||
Loading…
Reference in New Issue