Datenschutz vollmacht fixed, two time counter added

This commit is contained in:
2026-03-21 16:42:31 +01:00
parent eecc6cd73e
commit 38b3b7da73
56 changed files with 4401 additions and 789 deletions
+26
View File
@@ -0,0 +1,26 @@
/**
* Navigation-History über location.state.
* Jeder Link fügt die aktuelle URL zum Stack hinzu.
* Der Zurück-Button poppt den letzten Eintrag und gibt den Rest weiter.
*/
export interface NavState {
history?: string[];
}
/**
* Erstellt den state für einen Link - fügt die aktuelle URL zum History-Stack hinzu.
*/
export function pushHistory(currentPath: string, locationState?: unknown): NavState {
const prev = (locationState as NavState)?.history || [];
return { history: [...prev, currentPath] };
}
/**
* Gibt die Zurück-URL und den verbleibenden History-Stack zurück.
*/
export function popHistory(locationState?: unknown, fallback?: string): { to: string; state: NavState } {
const history = [...((locationState as NavState)?.history || [])];
const to = history.pop() || fallback || '/';
return { to, state: { history } };
}