fix: fetch inbox entry

This commit is contained in:
DIYgod 2024-10-04 04:06:34 +08:00
parent 61d9a48310
commit ecb2d33979
No known key found for this signature in database
1 changed files with 10 additions and 6 deletions

View File

@ -30,7 +30,7 @@ import { stopPropagation } from "~/lib/dom"
import { FeedViewType } from "~/lib/enum"
import { getNewIssueUrl } from "~/lib/issues"
import { cn } from "~/lib/utils"
import type { ActiveEntryId, FeedModel } from "~/models"
import type { ActiveEntryId, FeedModel, InboxModel } from "~/models"
import {
useIsSoFWrappedElement,
useWrappedElement,
@ -89,15 +89,19 @@ export const EntryContentRender: Component<{
}> = ({ entryId, noMedia, className, compact }) => {
const { t } = useTranslation()
const { error, data, isPending } = useAuthQuery(Queries.entries.byId(entryId), {
staleTime: 300_000,
})
const entry = useEntry(entryId)
useTitle(entry?.entries.title)
const feed = useFeedById(entry?.feedId) as FeedModel
const feed = useFeedById(entry?.feedId) as FeedModel | InboxModel
const readerRenderInlineStyle = useUISettingKey("readerRenderInlineStyle")
const { error, data, isPending } = useAuthQuery(
feed?.type === "inbox" ? Queries.entries.byInboxId(entryId) : Queries.entries.byId(entryId),
{
staleTime: 300_000,
},
)
const summary = useAuthQuery(
Queries.ai.summary({
entryId,