Skip to content

Commit b5fd9fd

Browse files
refactor: add subdocument exists check
1 parent 6cc6e60 commit b5fd9fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/component/common/editor/main/CollarCodeEditor.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,17 @@ const CollarCodeEditor: React.FC<EditorProps> = (props: EditorProps) => {
108108
}
109109
setEditorInstance(editorView);
110110
curSubYDoc.load();
111-
if (curEditorRootDoc) {
111+
let existDoc = curEditorRootDoc
112+
?.getMap("texhubsubdoc")
113+
.get(curSubYDoc.guid);
114+
if (curEditorRootDoc && BaseMethods.isNull(existDoc)) {
112115
debugger;
113116
curEditorRootDoc
114117
.getMap("texhubsubdoc")
115118
.set(curSubYDoc.guid, curSubYDoc);
116119
setCurRootYDoc(curEditorRootDoc);
120+
} else {
121+
console.warn("sudocument exists:" + curSubYDoc.guid);
117122
}
118123
}
119124
}, [curSubYDoc]);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy