fix: prevent 'No readable content' flash for markdown articles

- Check for markdown/html existence before checking finalHtml
- Show empty container while markdown is being converted to HTML
- Fixes issue where nostr blog posts briefly showed error message
This commit is contained in:
Gigi
2025-10-05 13:34:38 +01:00
parent 832740fb59
commit 320e7f000a

View File

@@ -183,12 +183,16 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
</div>
</div>
)}
{finalHtml ? (
<div
ref={contentRef}
className={markdown ? "reader-markdown" : "reader-html"}
dangerouslySetInnerHTML={{ __html: finalHtml }}
/>
{markdown || html ? (
finalHtml ? (
<div
ref={contentRef}
className={markdown ? "reader-markdown" : "reader-html"}
dangerouslySetInnerHTML={{ __html: finalHtml }}
/>
) : (
<div className="reader-markdown" ref={contentRef} />
)
) : (
<div className="reader empty">
<p>No readable content found for this URL.</p>