Split transactions when applying suggestions (#465)
This commit is contained in:
parent
b3cb0ea755
commit
029cbb835e
4 changed files with 75 additions and 20 deletions
|
|
@ -180,13 +180,18 @@ export function Canvas({
|
|||
);
|
||||
|
||||
const handleEditorChange = useCallback(
|
||||
(updatedContent: string) => {
|
||||
(updatedContent: string, debounce: boolean) => {
|
||||
if (document && updatedContent !== document.content) {
|
||||
debouncedHandleEditorChange(updatedContent);
|
||||
if (debounce) {
|
||||
debouncedHandleEditorChange(updatedContent);
|
||||
} else {
|
||||
handleContentChange(updatedContent);
|
||||
}
|
||||
|
||||
setIsContentDirty(true);
|
||||
}
|
||||
},
|
||||
[document, debouncedHandleEditorChange]
|
||||
[document, debouncedHandleEditorChange, handleContentChange]
|
||||
);
|
||||
|
||||
function getDocumentContentById(index: number) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue