Enhance character name display in DashboardWidget: Refactor character name construction logic in FalukantService to include title handling and create a new computed property for display name in DashboardWidget. Update styles for gender display and ensure proper localization for age representation.

This commit is contained in:
Torsten Schulz (local)
2026-01-29 17:28:58 +01:00
parent 8ec7db031b
commit 39ac149430
2 changed files with 22 additions and 5 deletions

View File

@@ -4776,8 +4776,9 @@ ORDER BY r.id`,
const character = falukantUser.character;
const firstName = character.definedFirstName?.name ?? '';
const lastName = character.definedLastName?.name ?? '';
const title = character.nobleTitle?.labelTr ?? '';
const characterName = [title, firstName, lastName].filter(Boolean).join(' ') || '—';
const titleLabelTr = character.nobleTitle?.labelTr ?? '';
const nameWithoutTitle = [firstName, lastName].filter(Boolean).join(' ') || '—';
const characterName = titleLabelTr ? [titleLabelTr, firstName, lastName].filter(Boolean).join(' ') : nameWithoutTitle;
const age = character.birthdate ? calcAge(character.birthdate) : null;
const [unreadNotificationsCount, childrenCount] = await Promise.all([
@@ -4794,6 +4795,8 @@ ORDER BY r.id`,
return {
characterName,
titleLabelTr: titleLabelTr || null,
nameWithoutTitle,
gender: character.gender ?? null,
age,
money: Number(falukantUser.money ?? 0),