fix: empty entry params to `pending`
Signed-off-by: Innei <i@innei.in>
This commit is contained in:
parent
1b9fb68788
commit
dff5a87d80
|
|
@ -1,5 +1,5 @@
|
|||
import { getReadonlyRoute, getStableRouterNavigate } from "@renderer/atoms"
|
||||
import { ROUTE_FEED_PENDING } from "@renderer/lib/constants"
|
||||
import { ROUTE_ENTRY_PENDING, ROUTE_FEED_PENDING } from "@renderer/lib/constants"
|
||||
import type { FeedViewType } from "@renderer/lib/enum"
|
||||
import { isUndefined } from "lodash-es"
|
||||
import { useCallback } from "react"
|
||||
|
|
@ -39,7 +39,7 @@ export const useNavigateEntry = () => useCallback((options: NavigateEntryOptions
|
|||
|
||||
return getStableRouterNavigate()?.(
|
||||
`/feeds/${finalFeedId}/${
|
||||
entryId || ROUTE_FEED_PENDING
|
||||
entryId || ROUTE_ENTRY_PENDING
|
||||
}?${nextSearchParams.toString()}`,
|
||||
)
|
||||
}, [])
|
||||
|
|
|
|||
|
|
@ -83,3 +83,4 @@ export const QUERY_PERSIST_KEY = getStorageNS("REACT_QUERY_OFFLINE_CACHE")
|
|||
|
||||
/// Route Keys
|
||||
export const ROUTE_FEED_PENDING = "all"
|
||||
export const ROUTE_ENTRY_PENDING = "pending"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useRouteView } from "@renderer/hooks/biz/useRouteParams"
|
||||
import { ROUTE_FEED_PENDING, views } from "@renderer/lib/constants"
|
||||
import { ROUTE_ENTRY_PENDING, views } from "@renderer/lib/constants"
|
||||
import { EntryContent } from "@renderer/modules/entry-content"
|
||||
import { AnimatePresence } from "framer-motion"
|
||||
import { useParams } from "react-router-dom"
|
||||
|
|
@ -12,7 +12,7 @@ export const Component = () => {
|
|||
<AnimatePresence>
|
||||
{!inWideMode && (
|
||||
<div className="min-w-0 flex-1">
|
||||
<EntryContent entryId={entryId === ROUTE_FEED_PENDING ? "" : entryId} />
|
||||
<EntryContent entryId={entryId === ROUTE_ENTRY_PENDING ? "" : entryId} />
|
||||
</div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { levels, ROUTE_FEED_PENDING } from "@renderer/lib/constants"
|
||||
import { levels, ROUTE_ENTRY_PENDING, ROUTE_FEED_PENDING } from "@renderer/lib/constants"
|
||||
import { FeedViewType } from "@renderer/lib/enum"
|
||||
import { redirect } from "react-router-dom"
|
||||
|
||||
|
|
@ -8,4 +8,4 @@ export function Component() {
|
|||
|
||||
export const loader = () =>
|
||||
// navigate to the first feed
|
||||
redirect(`/feeds/${ROUTE_FEED_PENDING}?view=${FeedViewType.Articles}&level=${levels.view}`)
|
||||
redirect(`/feeds/${ROUTE_FEED_PENDING}/${ROUTE_ENTRY_PENDING}?view=${FeedViewType.Articles}&level=${levels.view}`)
|
||||
|
|
|
|||
Loading…
Reference in New Issue