Обновить публичные идентификаторы файлов

This commit is contained in:
AidarKC
2026-11-15 15:45:33 +03:00
parent ac6a2e5b3f
commit 4a6e072946
65 changed files with 292 additions and 457 deletions
@@ -18,7 +18,7 @@ import { t } from '../../i18n/index.js';
import { renderUserAvatar, buildAvatarInitials } from '../../components/avatar-image.js';
import { state } from '../../state.js';
import { buildArweaveDataUrl } from '../../services/arweave-file-service.js';
import { resolvePublicFileUrl } from '../../services/public-file-service.js';
import { avatarR2Url } from '../../services/public-file-service.js';
const SVGNS = 'http://www.w3.org/2000/svg';
@@ -154,16 +154,11 @@ async function resolveServerAvatarPhotoSrc(src) {
const rawAvatar = src?.avatar;
if (!rawAvatar || typeof rawAvatar === 'string') return '';
const txId = String(rawAvatar?.ar || '').trim();
const sha256 = String(rawAvatar?.sha256Hex || rawAvatar?.sha256 || '').trim().toLowerCase();
const pr = String(rawAvatar?.pr || '').trim();
const authorLogin = String(src?.login || src?.id || '').trim();
if (txId || !sha256 || !authorLogin) return '';
if (txId || !pr || !authorLogin) return '';
try {
return await resolvePublicFileUrl({
sha256,
authorLogin,
solanaEndpoint: state?.entrySettings?.solanaServer,
fallbackServerLogin: state?.entrySettings?.shineServerLogin,
});
return avatarR2Url(pr);
} catch {
return '';
}
@@ -658,7 +653,7 @@ export function createForceGraph({ stage, model, onCenterTap, onNodeTap, onNodeL
// Единый PNG-оверлей на ВСЕХ полных орбах (фокус + спутники). tier-3 точки (dotOnly) сюда не идут.
const orb = buildPngOrb(photoSrc, { isFocus, initials });
dot.appendChild(orb);
if (!photoSrc && src?.avatar && typeof src.avatar === 'object' && !String(src.avatar.ar || '').trim() && String(src.avatar.sha256Hex || src.avatar.sha256 || '').trim()) {
if (!photoSrc && src?.avatar && typeof src.avatar === 'object' && !String(src.avatar.ar || '').trim() && String(src.avatar.pr || src.avatar.pr || '').trim()) {
void resolveServerAvatarPhotoSrc(src).then((url) => {
if (!url || !orb.isConnected) return;
const currentPhoto = orb.querySelector('.fg-pngorb-photo');