Skip to content

Commit

Permalink
fix: empty content
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jul 23, 2024
1 parent 6199dd2 commit 690efc3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/renderer/src/modules/entry-content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const EntryContent = ({ entryId }: { entryId: ActiveEntryId }) => {
function EntryContentRender({ entryId }: { entryId: string }) {
const user = useMe()

const { error, data } = useAuthQuery(Queries.entries.byId(entryId), {
const { error, data, isPending } = useAuthQuery(Queries.entries.byId(entryId), {
staleTime: 300_000,
})

Expand Down Expand Up @@ -187,13 +187,21 @@ function EntryContentRender({ entryId }: { entryId: string }) {
</WrappedElementProvider>
{!content && (
<div className="center mt-16">
{!error ? (
{isPending ? (
<LoadingCircle size="large" />
) : (
<div className="center flex flex-col gap-2">
<i className="i-mgc-close-cute-re text-3xl text-red-500" />
<span className="font-sans text-sm">Network Error</span>
</div>
error ?
(
<div className="center flex flex-col gap-2">
<i className="i-mgc-close-cute-re text-3xl text-red-500" />
<span className="font-sans text-sm">Network Error</span>
</div>
) :
(
<div className="center">
<span className="text-sm text-zinc-400">No content</span>
</div>
)
)}
</div>
)}
Expand Down

0 comments on commit 690efc3

Please sign in to comment.