Skip to content

Commit 09f6fb6

Browse files
committed
Message editor: add on change callback
Add a callback function for change events
1 parent 5de5ed0 commit 09f6fb6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/desktop/src/components/v3/editor/MessageEditor.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
stackId: string;
2525
markdown: boolean;
2626
initialValue?: string;
27+
onChange?: (text: string) => void;
2728
}
2829
29-
let { markdown = $bindable(), projectId, initialValue }: Props = $props();
30+
let { markdown = $bindable(), projectId, initialValue, onChange }: Props = $props();
3031
3132
const [aiService, idSelection, worktreeService, diffService] = inject(
3233
AIService,
@@ -78,10 +79,11 @@
7879
}
7980
8081
async function handleChange(
81-
_text: string,
82+
text: string,
8283
textUpToAnchor: string | undefined,
8384
textAfterAnchor: string | undefined
8485
) {
86+
onChange?.(text);
8587
await suggestionsHandler.onChange(textUpToAnchor, textAfterAnchor);
8688
}
8789

0 commit comments

Comments
 (0)