Skip to content

Commit

Permalink
[#70071] do not make extra connections from git wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Trzcin committed Jan 30, 2025
1 parent 862c024 commit ae76128
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/myst-git/MystEditorGit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const MystEditorGit = ({
const file = useSignal();
const initialText = useSignal("");
const room = useComputed(() => (commit.value && file.value ? `${repo}/${branch.value}/${commit.value.hash}/${file.value}` : ""));
const mystState = useRef(createMystState({ ...props }));
const mystState = useRef(createMystState({ ...props, collaboration: { ...props.collaboration, mode: "manual" } }));
const changeHistory = useSignal(initialHistory);
const toast = useSignal({ content: null, timeout: null });
const commitSummary = useSignal(null);
Expand All @@ -166,8 +166,9 @@ const MystEditorGit = ({
});

useSignalEffect(() => {
if (!room.value) return;
const collaboration = mystState.current.options.collaboration.peek();
mystState.current.options.collaboration.value = { ...collaboration, room: room.value };
mystState.current.options.collaboration.value = { ...collaboration, room: room.value, mode: props.collaboration.mode };
});

function toastNotify(content) {
Expand Down

0 comments on commit ae76128

Please sign in to comment.