SHA256
Обновить публичные идентификаторы файлов
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user