mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
Fix SITES tab: check for modal before getElementById on missing pane
This commit is contained in:
@@ -1507,14 +1507,15 @@ async function loadNews() {
|
||||
|
||||
// ── TABS ──────────────────────────────────────────────────────────────
|
||||
function switchTab(name) {
|
||||
if (name === 'sites') { openSitesModal(); return; }
|
||||
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
|
||||
document.querySelectorAll('.tab-pane').forEach(p => p.classList.remove('active'));
|
||||
event.target.classList.add('active');
|
||||
document.getElementById('tab-'+name).classList.add('active');
|
||||
const pane = document.getElementById('tab-'+name);
|
||||
if (pane) pane.classList.add('active');
|
||||
if (name === 'news') loadNews();
|
||||
if (name === 'agents') loadAgents();
|
||||
if (name === 'alerts') loadAlerts();
|
||||
if (name === 'sites') { openSitesModal(); return; }
|
||||
}
|
||||
|
||||
// ── CHAT ──────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user