mirror of
https://github.com/open-webui/open-webui
synced 2025-06-22 18:07:17 +00:00
Merge 87eba030b2
into aef0ad2d10
This commit is contained in:
commit
6ed209133d
@ -59,6 +59,9 @@
|
||||
export let shiftEnter = false;
|
||||
export let largeTextAsFile = false;
|
||||
|
||||
let isUserEditing = false;
|
||||
let lastSyncedValue = value;
|
||||
|
||||
let element;
|
||||
let editor;
|
||||
|
||||
@ -256,7 +259,9 @@
|
||||
}
|
||||
|
||||
if (value !== newValue) {
|
||||
isUserEditing = true;
|
||||
value = newValue;
|
||||
lastSyncedValue = newValue;
|
||||
|
||||
// check if the node is paragraph as well
|
||||
if (editor.isActive('paragraph')) {
|
||||
@ -409,7 +414,9 @@
|
||||
});
|
||||
|
||||
$: if (value !== null && editor) {
|
||||
onValueChange();
|
||||
if (!isUserEditing && value !== lastSyncedValue) {
|
||||
onValueChange();
|
||||
}
|
||||
}
|
||||
|
||||
const onValueChange = () => {
|
||||
@ -447,6 +454,8 @@
|
||||
); // Update editor content
|
||||
|
||||
selectTemplate();
|
||||
lastSyncedValue = value;
|
||||
isUserEditing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user