ыввы
This commit is contained in:
@@ -18,9 +18,14 @@ export function RichTextMessageContent({ value, tone = 'default' }: RichTextMess
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (!editor) return
|
||||
if (!editor || editor.isDestroyed) return
|
||||
const normalizedValue = value.trim() ? value : '<p></p>'
|
||||
if (editor.getHTML() === normalizedValue) return
|
||||
try {
|
||||
if (editor.getHTML() === normalizedValue) return
|
||||
} catch {
|
||||
// editor schema not ready yet
|
||||
return
|
||||
}
|
||||
editor.commands.setContent(normalizedValue, { emitUpdate: false })
|
||||
}, [editor, value])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user