Fix DM name fallbacks and chat header

This commit is contained in:
AidarKC
2026-09-02 14:23:42 +04:00
parent 079be37fff
commit 53cd55a2a0
4 changed files with 85 additions and 41 deletions
@@ -116,6 +116,9 @@ export async function loadProfileSnapshot(login) {
});
}
const firstName = String(fields.find((field) => field.key === 'first_name')?.value || '').trim();
const lastName = String(fields.find((field) => field.key === 'last_name')?.value || '').trim();
const latestAccountRole = loadLatestByAliasesFromItems(items, ['account_role']);
const rawAccountRole = String(latestAccountRole?.value || '').trim().toLowerCase();
const accountRole = rawAccountRole === PROFILE_ACCOUNT_ROLE_PRIMARY || rawAccountRole === PROFILE_ACCOUNT_ROLE_NON_VOTING
@@ -157,6 +160,8 @@ export async function loadProfileSnapshot(login) {
return {
fields,
firstName,
lastName,
toggles,
accountRole,
accountRoleTimeMs: latestAccountRole?.timeMs || 0,