mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
refac
This commit is contained in:
@@ -215,7 +215,9 @@
|
|||||||
|
|
||||||
if (state.length === 2 && state[0] === 0 && state[1] === 0) {
|
if (state.length === 2 && state[0] === 0 && state[1] === 0) {
|
||||||
// Empty state, check if we have content to initialize
|
// Empty state, check if we have content to initialize
|
||||||
if (content) {
|
// check if editor empty as well
|
||||||
|
const isEmptyEditor = !editor || editor.getText().trim() === '';
|
||||||
|
if (content && isEmptyEditor) {
|
||||||
const pydoc = prosemirrorJSONToYDoc(editor.schema, content);
|
const pydoc = prosemirrorJSONToYDoc(editor.schema, content);
|
||||||
if (pydoc) {
|
if (pydoc) {
|
||||||
Y.applyUpdate(this.doc, Y.encodeStateAsUpdate(pydoc));
|
Y.applyUpdate(this.doc, Y.encodeStateAsUpdate(pydoc));
|
||||||
|
|||||||
Reference in New Issue
Block a user