Skip to content

Commit

Permalink
fix: fetch inbox entry
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Oct 3, 2024
1 parent 61d9a48 commit ecb2d33
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions apps/renderer/src/modules/entry-content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ecb2d33

Please sign in to comment.