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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user