File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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' , ( ) => {
You can’t perform that action at this time.
0 commit comments