Lashtw commited on
Commit
1320c52
·
verified ·
1 Parent(s): 97f4a30

Upload 10 files

Browse files
Files changed (1) hide show
  1. src/views/InstructorView.js +9 -3
src/views/InstructorView.js CHANGED
@@ -1299,7 +1299,11 @@ if (navInstBtn) {
1299
 
1300
  if (instructorData) {
1301
  console.log("Hiding Modal and Setting Permissions...");
1302
- if (authModal) authModal.classList.add('hidden');
 
 
 
 
1303
  checkPermissions(instructorData);
1304
 
1305
  // Auto-Restore Room View if exists
@@ -1335,7 +1339,8 @@ if (navInstBtn) {
1335
  // Show unauthorized message
1336
  authErrorMsg.textContent = "此帳號無講師權限";
1337
  authErrorMsg.classList.remove('hidden');
1338
- authModal.classList.remove('hidden'); // Ensure modal stays up
 
1339
  }
1340
  } catch (e) {
1341
  console.error("Permission Check Failed:", e);
@@ -1345,7 +1350,8 @@ if (navInstBtn) {
1345
  }
1346
  }
1347
  } else {
1348
- authModal.classList.remove('hidden');
 
1349
  }
1350
  });
1351
  });
 
1299
 
1300
  if (instructorData) {
1301
  console.log("Hiding Modal and Setting Permissions...");
1302
+ // Re-query authModal to ensure we have the live element in case of re-renders
1303
+ const liveAuthModal = document.getElementById('auth-modal');
1304
+ if (liveAuthModal) liveAuthModal.classList.add('hidden');
1305
+ else console.warn("Live authModal not found!");
1306
+
1307
  checkPermissions(instructorData);
1308
 
1309
  // Auto-Restore Room View if exists
 
1339
  // Show unauthorized message
1340
  authErrorMsg.textContent = "此帳號無講師權限";
1341
  authErrorMsg.classList.remove('hidden');
1342
+ const liveAuthModal = document.getElementById('auth-modal');
1343
+ if (liveAuthModal) liveAuthModal.classList.remove('hidden');
1344
  }
1345
  } catch (e) {
1346
  console.error("Permission Check Failed:", e);
 
1350
  }
1351
  }
1352
  } else {
1353
+ const liveAuthModal = document.getElementById('auth-modal');
1354
+ if (liveAuthModal) liveAuthModal.classList.remove('hidden');
1355
  }
1356
  });
1357
  });