SHA256
Добавить Canvas v4 для исследования связей
This commit is contained in:
@@ -95,11 +95,11 @@ export function formatShortAge(timestampMs) {
|
||||
if (!ts) return '';
|
||||
const ageMinutes = Math.max(0, Math.floor((Date.now() - ts) / 60000));
|
||||
if (ageMinutes < 1) return formatRelative(0, 'second');
|
||||
if (ageMinutes < 60) return formatRelative(-ageMinutes, 'minute', { numeric: 'always', style: 'narrow' });
|
||||
if (ageMinutes < 60) return formatRelative(-ageMinutes, 'minute', { numeric: 'always' });
|
||||
const ageHours = Math.floor(ageMinutes / 60);
|
||||
if (ageHours < 24) return formatRelative(-ageHours, 'hour', { numeric: 'always', style: 'narrow' });
|
||||
if (ageHours < 24) return formatRelative(-ageHours, 'hour', { numeric: 'always' });
|
||||
const ageDays = Math.floor(ageHours / 24);
|
||||
if (ageDays < 7) return formatRelative(-ageDays, 'day', { numeric: 'always', style: 'narrow' });
|
||||
if (ageDays < 7) return formatRelative(-ageDays, 'day', { numeric: 'always' });
|
||||
const dt = new Date(ts);
|
||||
const day = shortDay(dt);
|
||||
return dt.getFullYear() === new Date().getFullYear() ? day : `${day} ${dt.getFullYear()}`;
|
||||
|
||||
@@ -174,6 +174,12 @@ export async function loadProfileSnapshot(login) {
|
||||
};
|
||||
}
|
||||
|
||||
export function profileDisplayName(snapshot, fallback = '') {
|
||||
const fields = Array.isArray(snapshot?.fields) ? snapshot.fields : [];
|
||||
const valueOf = (key) => String(fields.find((field) => field?.key === key)?.value || '').trim();
|
||||
return [valueOf('first_name'), valueOf('last_name')].filter(Boolean).join(' ') || String(fallback || '').trim();
|
||||
}
|
||||
|
||||
export async function saveProfileParamBlock(login, key, value) {
|
||||
const storagePwd = await getStoragePwd();
|
||||
await authService.addBlockUserParam({
|
||||
|
||||
Reference in New Issue
Block a user