Skip to content

Commit e923c99

Browse files
committed
live updating of sessions in a lobby now only occur when the experiment is running to avoid session ordering issues
1 parent 1cc71b2 commit e923c99

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

manager/src/templates/lobby.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ <h2>Add a Session</h2>
140140
const addSessionForm = document.getElementById('add-session-form');
141141

142142
let sessionsDragged = false;
143+
let experimentRunning = false;
143144

144145
// Show modal
145146
addSessionBtn.addEventListener('click', showModal);
@@ -437,6 +438,7 @@ <h2>Add a Session</h2>
437438
.then(data => {
438439
if (data.status === 'success') {
439440
const lobby = data.lobby;
441+
experimentRunning = lobby.experimentRunning;
440442
updateButtonState(lobby.experimentRunning, lobby.readyStatus, lobby.hasSessions);
441443
updateParticipantStatuses(lobby.players, lobby.readyStatus);
442444
} else {
@@ -445,7 +447,7 @@ <h2>Add a Session</h2>
445447
}
446448
})
447449
.catch(error => console.error('Error:', error));
448-
fetchSessions();
450+
if(experimentRunning === true) fetchSessions()
449451
}
450452

451453
toggleGameBtn.addEventListener('click', () => {

0 commit comments

Comments
 (0)