mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🐛 fix: slove the old agents open profiles error problem (#11204)
fix: slove the old agents open profiles error problem
This commit is contained in:
@@ -33,7 +33,9 @@ const EditorCanvas = memo(() => {
|
||||
const editorData = config?.editorData;
|
||||
const systemRole = config?.systemRole;
|
||||
const updateConfig = useAgentStore((s) => s.updateAgentConfig);
|
||||
const [initialLoad] = useState(editorData || EMPTY_EDITOR_STATE);
|
||||
const [initialLoad] = useState(
|
||||
editorData === undefined || editorData?.root === undefined ? EMPTY_EDITOR_STATE : editorData,
|
||||
);
|
||||
const mentionOptions = useMentionOptions();
|
||||
const editor = useProfileStore((s) => s.editor);
|
||||
const handleContentChange = useProfileStore((s) => s.handleContentChange);
|
||||
@@ -89,7 +91,7 @@ const EditorCanvas = memo(() => {
|
||||
// Don't init if streaming is in progress
|
||||
if (streamingInProgress) return;
|
||||
try {
|
||||
if (editorData) {
|
||||
if (editorData && editorData?.root !== undefined) {
|
||||
editor.setDocument('json', editorData);
|
||||
} else if (systemRole) {
|
||||
editor.setDocument('markdown', systemRole);
|
||||
|
||||
Reference in New Issue
Block a user