From 7f41ee380a8f9f2fb2d4d516d7d22816195bf060 Mon Sep 17 00:00:00 2001 From: Ulas Date: Tue, 31 Mar 2026 13:31:57 +0200 Subject: [PATCH] refactor: move --active-module-accent update into navigate() to avoid duplicate ROUTES.find Co-Authored-By: Claude Sonnet 4.6 --- public/router.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/router.js b/public/router.js index 89078d9..e4e1745 100644 --- a/public/router.js +++ b/public/router.js @@ -145,6 +145,9 @@ async function navigate(path, userOrPushState = true, pushState = true) { history.pushState({ path }, '', path); } + const accent = route?.module ? getCSSToken(`--module-${route.module}`) : ''; + document.documentElement.style.setProperty('--active-module-accent', accent); + await renderPage(route, previousPath); updateNav(path); updateThemeColorForRoute(route); @@ -322,10 +325,7 @@ function updateNav(path) { // Bottom-Nav zur aktiven Seite scrollen scrollNavToActive(); - // Modul-Akzentfarbe auf :root setzen — wird von Nav-CSS gelesen - const route = ROUTES.find(r => r.path === path); - const accent = route?.module ? getCSSToken(`--module-${route.module}`) : ''; - document.documentElement.style.setProperty('--active-module-accent', accent || ''); + // Modul-Akzentfarbe wird in navigate() gesetzt, wo route bereits aufgelöst ist. } function renderError(container, err) {