Lashtw commited on
Commit
583a503
·
verified ·
1 Parent(s): 3e41f43

Upload 9 files

Browse files
Files changed (1) hide show
  1. src/views/InstructorView.js +4 -22
src/views/InstructorView.js CHANGED
@@ -790,28 +790,10 @@ export function setupInstructorEvents() {
790
  const savedRoomCode = localStorage.getItem('vibecoding_room_code');
791
  if (savedRoomCode) {
792
  console.log("Restoring Room Session:", savedRoomCode);
793
- const roomInfo = document.getElementById('room-info');
794
- const displayRoomCode = document.getElementById('display-room-code');
795
- const createContainer = document.getElementById('create-room-container');
796
- const dashboardContent = document.getElementById('dashboard-content');
797
-
798
- // Restore UI
799
- createContainer.classList.add('hidden');
800
- roomInfo.classList.remove('hidden');
801
- dashboardContent.classList.remove('hidden');
802
- displayRoomCode.textContent = savedRoomCode;
803
-
804
- // Re-subscribe locally using the existing updateDashboard logic if available,
805
- // or we need to redefine the callback here.
806
- // Since updateDashboard is inside createBtn scope, we can't mistakenly access it if it's not global.
807
- // Wait, updateDashboard IS inside createBtn scope. That's a problem.
808
- // We need to move updateDashboard out or duplicate the logic here.
809
- // Duplicating logic for robustness:
810
- subscribeToRoom(savedRoomCode, (data) => {
811
- const users = Array.isArray(data) ? data : (data?.users ? Object.values(data.users) : []);
812
- currentStudents = users;
813
- renderTransposedHeatmap(users);
814
- });
815
  }
816
 
817
  } else {
 
790
  const savedRoomCode = localStorage.getItem('vibecoding_room_code');
791
  if (savedRoomCode) {
792
  console.log("Restoring Room Session:", savedRoomCode);
793
+ // Restore Room Session using the unified function
794
+ // This ensures all UI elements (including Group Photo button) are shown correctly
795
+ console.log("Calling enterRoom to restore session...");
796
+ enterRoom(savedRoomCode);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
797
  }
798
 
799
  } else {