website cleanup

This commit is contained in:
2025-12-24 21:44:58 +01:00
parent 9b683a59d3
commit d78854a4c6
277 changed files with 6141 additions and 2693 deletions

View File

@@ -16,6 +16,24 @@ export class SessionViewModel {
driverId?: string;
isAuthenticated: boolean = true;
/**
* Compatibility accessor.
* Some legacy components expect `session.user.*`.
*/
get user(): {
userId: string;
email: string;
displayName: string;
primaryDriverId?: string | null;
} {
return {
userId: this.userId,
email: this.email,
displayName: this.displayName,
primaryDriverId: this.driverId ?? null,
};
}
/** UI-specific: User greeting */
get greeting(): string {
return `Hello, ${this.displayName}!`;
@@ -26,7 +44,7 @@ export class SessionViewModel {
if (this.displayName) {
return this.displayName.split(' ').map(n => n[0]).join('').toUpperCase();
}
return this.email[0].toUpperCase();
return (this.email?.[0] ?? '?').toUpperCase();
}
/** UI-specific: Whether has driver profile */
@@ -38,4 +56,4 @@ export class SessionViewModel {
get authStatusDisplay(): string {
return this.isAuthenticated ? 'Logged In' : 'Logged Out';
}
}
}