From 39ac149430159f7a41bc2bcd9c8411ed857d5df9 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 29 Jan 2026 17:28:58 +0100 Subject: [PATCH] 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. --- backend/services/falukantService.js | 7 +++++-- frontend/src/components/DashboardWidget.vue | 20 +++++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index c512545..a0a88f3 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -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), diff --git a/frontend/src/components/DashboardWidget.vue b/frontend/src/components/DashboardWidget.vue index d0d3a97..76754b4 100644 --- a/frontend/src/components/DashboardWidget.vue +++ b/frontend/src/components/DashboardWidget.vue @@ -25,7 +25,7 @@