Refactor router navigation handling: Update beforeEach hook in router.js to prevent incorrect route matching on initial load. Ensure proper path normalization and query handling to enhance navigation reliability.
All checks were successful
Deploy miriamgemeinde / deploy (push) Successful in 6s
All checks were successful
Deploy miriamgemeinde / deploy (push) Successful in 6s
This commit is contained in:
@@ -156,7 +156,10 @@ router.beforeEach(async (to, from, next) => {
|
||||
next({ path: normalizedToPath, query: to.query, hash: to.hash, replace: true });
|
||||
return;
|
||||
}
|
||||
next({ ...to, replace: true });
|
||||
// Wichtig: nicht `...to` übernehmen, da `to` beim Initial-Load ggf. bereits
|
||||
// auf der Catch-All-Route gematcht wurde. Dann würde der NotFound-Match
|
||||
// trotz inzwischen geladener Menüroute "kleben" bleiben.
|
||||
next({ path: normalizedToPath, query: to.query, hash: to.hash, replace: true });
|
||||
} else {
|
||||
// Sicherstellen, dass Kernrouten immer verfügbar sind
|
||||
ensureCoreRoutes();
|
||||
|
||||
Reference in New Issue
Block a user