Skip to content

Commit 0c72925

Browse files
committed
fix: resolve AbortError and fix suggestion chips visibility
- Add isMountedRef guard to editor initialization effect - Fix initialization effect dependency to properly watch currentDocument - Remove invalid 'on-empty' parameter from suggestions (restore defaults) - Prevents state updates after unmount that caused AbortError
1 parent 280e8f2 commit 0c72925

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

apps/app/src/app/canvas/page.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@ const DocumentEditor = () => {
163163

164164
// Initialize editor with default document on mount
165165
useEffect(() => {
166-
if (editor && currentDocument) {
167-
editor.commands.setContent(fromMarkdown(currentDocument));
168-
}
169-
}, [editor]);
166+
if (!editor || !isMountedRef.current) return;
167+
editor.commands.setContent(fromMarkdown(currentDocument));
168+
}, [editor, currentDocument]);
170169

171170
// Cleanup on unmount to prevent state updates after component is removed
172171
useEffect(() => {
@@ -210,7 +209,6 @@ const DocumentEditor = () => {
210209
message: "Write a comprehensive guide to microservices architecture, covering service decomposition, inter-service communication, data consistency, and deployment patterns.",
211210
},
212211
],
213-
available: "on-empty",
214212
});
215213

216214
const { agent } = useAgent({

0 commit comments

Comments
 (0)