File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/app/[variants]/(main)/chat/profile/features/EditorCanvas Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ const EditorCanvas = memo(() => {
3333 const editorData = config ?. editorData ;
3434 const systemRole = config ?. systemRole ;
3535 const updateConfig = useAgentStore ( ( s ) => s . updateAgentConfig ) ;
36- const [ initialLoad ] = useState ( editorData || EMPTY_EDITOR_STATE ) ;
36+ const [ initialLoad ] = useState (
37+ editorData === undefined || editorData ?. root === undefined ? EMPTY_EDITOR_STATE : editorData ,
38+ ) ;
3739 const mentionOptions = useMentionOptions ( ) ;
3840 const editor = useProfileStore ( ( s ) => s . editor ) ;
3941 const handleContentChange = useProfileStore ( ( s ) => s . handleContentChange ) ;
@@ -89,7 +91,7 @@ const EditorCanvas = memo(() => {
8991 // Don't init if streaming is in progress
9092 if ( streamingInProgress ) return ;
9193 try {
92- if ( editorData ) {
94+ if ( editorData && editorData ?. root !== undefined ) {
9395 editor . setDocument ( 'json' , editorData ) ;
9496 } else if ( systemRole ) {
9597 editor . setDocument ( 'markdown' , systemRole ) ;
You can’t perform that action at this time.
0 commit comments