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

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
+4 -9
View File
@@ -30,7 +30,7 @@ import { t } from '../../i18n/index.js';
import { 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';
import { ISLAND_COLORS, layoutIslands, tieWeight } from './communities.js';
const NODE_R = { focus: 30, 1: 22, 2: 15, 3: 11 };
@@ -629,16 +629,11 @@ function avatarUrlSync(node) {
async function avatarUrlFromServer(node) {
const raw = node?.avatar;
if (!raw || typeof raw !== 'object') return '';
const sha256 = String(raw.sha256Hex || raw.sha256 || '').trim().toLowerCase();
const pr = String(raw.pr || '').trim();
const authorLogin = String(node?.login || node?.id || '').trim();
if (String(raw.ar || '').trim() || !sha256 || !authorLogin) return '';
if (String(raw.ar || '').trim() || !pr || !authorLogin) return '';
try {
return await resolvePublicFileUrl({
sha256,
authorLogin,
solanaEndpoint: state?.entrySettings?.solanaServer,
fallbackServerLogin: state?.entrySettings?.shineServerLogin,
});
return avatarR2Url(pr);
} catch {
return '';
}