fine tuning

This commit is contained in:
Ryan Peters 2024-01-17 20:40:27 -05:00
parent 88bbbc5e91
commit 9d1c8568ce
2 changed files with 10 additions and 2 deletions

View File

@ -30,7 +30,7 @@ namespace BinaryDad.Coding.Hubs
{ {
Console.WriteLine($"Sending code from {user}"); Console.WriteLine($"Sending code from {user}");
return Clients.All.SendAsync("ReceiveCode", user, index, code); return Clients.Others.SendAsync("ReceiveCode", user, index, code);
} }

View File

@ -14,6 +14,7 @@
let isTeacher = window.location.hash === '#4ELQcUq7UnFGghAZCVr4Chr9JmtncigfkGu5WSf9'; let isTeacher = window.location.hash === '#4ELQcUq7UnFGghAZCVr4Chr9JmtncigfkGu5WSf9';
let isLive = false; let isLive = false;
let editorLock = false;
let isLiveMode = function () { let isLiveMode = function () {
@ -73,8 +74,12 @@
if (!isTeacher && isLive) { if (!isTeacher && isLive) {
editorLock = true;
let editor = ace.edit($editors[index]); let editor = ace.edit($editors[index]);
editorLock = false;
editor.session.setValue(code); editor.session.setValue(code);
} }
}); });
@ -100,7 +105,10 @@
let editor = ace.edit(e); let editor = ace.edit(e);
editor.session.on('change', function () { editor.session.on('change', function () {
if (!editorLock) {
updateCode(editor, i); updateCode(editor, i);
};
}); });
// send initial code // send initial code