This commit is contained in:
@ -104,6 +104,8 @@ function updateNav() {
|
||||
const nav = document.getElementById('mainNav');
|
||||
const userInfo = document.getElementById('userInfo');
|
||||
document.body.classList.toggle('logged-in', isLoggedIn());
|
||||
const hash = window.location.hash.slice(1) || '/';
|
||||
document.body.classList.toggle('login-active', hash === '/login' || hash.startsWith('/login?'));
|
||||
if (isLoggedIn()) {
|
||||
nav.style.display = '';
|
||||
const role = getRole();
|
||||
@ -117,7 +119,6 @@ function updateNav() {
|
||||
});
|
||||
|
||||
// Highlight active nav link
|
||||
const hash = window.location.hash.slice(1) || '/';
|
||||
document.querySelectorAll('.sidebar-nav a').forEach(a => {
|
||||
const href = a.getAttribute('href').slice(1);
|
||||
let active = hash === href;
|
||||
|
||||
Reference in New Issue
Block a user