mirror of
https://github.com/block/buzz.git
synced 2026-10-30 22:11:36 +00:00
fix: guard EditorContent against null editor in tiptap 3.23.6
tiptap v3.19+ throws when EditorContent receives a null editor (ueberdosis/tiptap#7529). useEditor() returns null on the first render cycle before the instance is constructed — this was tolerated in 3.22.5 but crashes silently in 3.23.6, killing the entire ChannelPane subtree.
This commit is contained in:
@@ -451,7 +451,7 @@ export function ForumComposer({
|
||||
className="rich-text-composer max-h-32 overflow-y-auto"
|
||||
onKeyDown={handleEditorKeyDown}
|
||||
>
|
||||
<EditorContent editor={richText.editor} />
|
||||
{richText.editor && <EditorContent editor={richText.editor} />}
|
||||
</div>
|
||||
|
||||
<MessageComposerToolbar
|
||||
|
||||
@@ -31,7 +31,7 @@ export function ForumComposerCompactLayout({
|
||||
className="rich-text-composer max-h-10 min-w-0 flex-1 overflow-y-auto"
|
||||
onKeyDown={onEditorKeyDown}
|
||||
>
|
||||
<EditorContent editor={editor} />
|
||||
{editor && <EditorContent editor={editor} />}
|
||||
</div>
|
||||
<Button
|
||||
aria-label={isSending ? "Sending" : "Send message"}
|
||||
|
||||
@@ -720,7 +720,7 @@ export function MessageComposer({
|
||||
ref={composerScrollRef}
|
||||
onKeyDown={handleEditorKeyDown}
|
||||
>
|
||||
<EditorContent editor={richText.editor} />
|
||||
{richText.editor && <EditorContent editor={richText.editor} />}
|
||||
</div>
|
||||
|
||||
<MessageComposerToolbar
|
||||
|
||||
Reference in New Issue
Block a user