Skip to content

Commit

Permalink
🐛 fix research-and-writing links still rendering on bake even when co…
Browse files Browse the repository at this point in the history
…ntent is invalid
  • Loading branch information
ikesau committed May 15, 2024
1 parent 29b9e78 commit 80c9e3e
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions site/gdocs/components/ResearchAndWriting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,21 @@ function ResearchAndWritingLink(
const { linkedDocument, errorMessage } = useLinkedDocument(url)
const { isPreviewing } = useContext(DocumentContext)

if (isPreviewing && errorMessage) {
return (
<div className={cx(className, "research-and-writing-link--error")}>
<p>{errorMessage}</p>
<p>This block won't render during baking</p>
</div>
)
if (errorMessage) {
if (isPreviewing) {
return (
<div
className={cx(
className,
"research-and-writing-link--error"
)}
>
<p>{errorMessage}</p>
<p>This block won't render during baking</p>
</div>
)
}
return null
}

if (linkedDocument) {
Expand Down

0 comments on commit 80c9e3e

Please sign in to comment.