Brand/404: route to Dashboard and sync user
Ensure brand click reliably routes to Dashboard by making navigateToBrandTarget async and fetching current user if not yet loaded (prevents misnavigation to Welcome). Update mobile account menu label to "Zum Dashboard". Change 404 page primary CTA/text to point to the Dashboard and make navigateBack fall back to Dashboard. Update codexInfo.md to document these changes and note the new codexinfo-komprimieren skill.
This commit is contained in:
+16
-4
@@ -128,9 +128,21 @@ function toggleTheme() {
|
||||
applyTheme(isDarkTheme.value ? 'light' : 'dark')
|
||||
}
|
||||
|
||||
function navigateToBrandTarget() {
|
||||
const targetRouteName = isAuthenticated.value ? 'Dashboard' : 'Home'
|
||||
void router.push({ name: targetRouteName })
|
||||
async function navigateToBrandTarget() {
|
||||
let resolvedUser = currentUser.value
|
||||
|
||||
if (!resolvedUser) {
|
||||
try {
|
||||
resolvedUser = await fetchCurrentUser()
|
||||
currentUser.value = resolvedUser
|
||||
} catch {
|
||||
resolvedUser = null
|
||||
currentUser.value = null
|
||||
}
|
||||
}
|
||||
|
||||
const targetRouteName = resolvedUser ? 'Dashboard' : 'Home'
|
||||
await router.push({ name: targetRouteName })
|
||||
}
|
||||
|
||||
async function refreshAuthState(options: { force?: boolean } = {}) {
|
||||
@@ -288,7 +300,7 @@ watch(
|
||||
<v-list density="compact" class="account-menu-list">
|
||||
<v-list-item
|
||||
prepend-icon="mdi-view-dashboard-outline"
|
||||
title="Zum Dash"
|
||||
title="Zum Dashboard"
|
||||
:to="{ name: 'Dashboard' }"
|
||||
/>
|
||||
<v-divider />
|
||||
|
||||
@@ -11,7 +11,7 @@ function navigateBack() {
|
||||
return
|
||||
}
|
||||
|
||||
router.push('/welcome')
|
||||
router.push({ name: 'Dashboard' })
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -29,11 +29,13 @@ function navigateBack() {
|
||||
<h1>Seite nicht gefunden</h1>
|
||||
<p class="not-found-text">
|
||||
Der Link ist ungültig oder die Seite wurde verschoben. Du kannst direkt zur
|
||||
Startseite zurück oder die vorherige Ansicht öffnen.
|
||||
Dashboard-Seite zurück oder die vorherige Ansicht öffnen.
|
||||
</p>
|
||||
|
||||
<div class="not-found-actions hoard-action-row">
|
||||
<v-btn color="primary" prepend-icon="mdi-home" to="/welcome">Zur Startseite</v-btn>
|
||||
<v-btn color="primary" prepend-icon="mdi-view-dashboard-outline" :to="{ name: 'Dashboard' }">
|
||||
Zum Dashboard
|
||||
</v-btn>
|
||||
<v-btn variant="outlined" prepend-icon="mdi-arrow-left" @click="navigateBack">Zurück</v-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user