Refine direct message profile data

This commit is contained in:
AidarKC
2026-09-02 14:56:33 +04:00
parent 065616a18b
commit 1373283947
5 changed files with 77 additions and 29 deletions
@@ -116,9 +116,6 @@ 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
@@ -160,8 +157,6 @@ export async function loadProfileSnapshot(login) {
return {
fields,
firstName,
lastName,
toggles,
accountRole,
accountRoleTimeMs: latestAccountRole?.timeMs || 0,