diff --git a/src/renderer/src/lib/utils.ts b/src/renderer/src/lib/utils.ts index ef5d87ba85..6fb41f1343 100644 --- a/src/renderer/src/lib/utils.ts +++ b/src/renderer/src/lib/utils.ts @@ -85,7 +85,7 @@ export const isSafari = memoize(() => { // eslint-disable-next-line no-control-regex export const isASCII = (str) => /^[\u0000-\u007F]*$/.test(str) -export const isBizId = (id) => { +export const isBizId = (id: string) => { if (!id) return false // id is uuid or snowflake diff --git a/src/renderer/src/modules/entry-column/index.tsx b/src/renderer/src/modules/entry-column/index.tsx index 97f7c032e5..dfea3f5543 100644 --- a/src/renderer/src/modules/entry-column/index.tsx +++ b/src/renderer/src/modules/entry-column/index.tsx @@ -15,6 +15,7 @@ import { EllipsisHorizontalTextWithTooltip } from "@renderer/components/ui/typog import { FEED_COLLECTION_LIST, ROUTE_ENTRY_PENDING, + ROUTE_FEED_PENDING, views, } from "@renderer/constants" import { shortcuts } from "@renderer/constants/shortcuts" @@ -209,6 +210,14 @@ const AddFeedHelper = () => { const feedId = useRouteParamsSelector((s) => s.feedId) const feedQuery = useFeed({ id: feedId }) + if (!feedId) { return } + if (feedId === FEED_COLLECTION_LIST || feedId === ROUTE_FEED_PENDING) { + return null + } + if (!isBizId(feedId)) { + return null + } + if (feedQuery.error && feedQuery.error.statusCode === 404) { throw new FeedNotFound() }