Skip to content

Commit

Permalink
fix: remove replacing empty remote state
Browse files Browse the repository at this point in the history
  • Loading branch information
Trzcin committed Nov 20, 2024
1 parent 1b194f3 commit 073d97c
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/components/CodeMirror.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@ const CodeMirror = ({ text, root, mode, spellcheckOpts, highlights, collaboratio
if (editorView.value) return;
if (collaboration.error) return;

if (collaboration.ytext?.toString().length === 0 && text.get().length > 0) {
console.warn("[Collaboration] Remote state is empty, overriding with local state");
collaboration.ytext.insert(0, text.get());
}

if (collaboration.opts.enabled) {
text.set(collaboration.ytext.toString());
collaboration.ytext.observe((ev, tr) => {
Expand Down

0 comments on commit 073d97c

Please sign in to comment.