Обновить обработку аватаров и вложений

This commit is contained in:
AidarKC
2026-10-07 14:05:01 +03:00
parent 7b8e178723
commit d8f42c769c
35 changed files with 628 additions and 222 deletions
+5 -7
View File
@@ -1,5 +1,5 @@
import { openArweaveAttachmentManager } from './arweave-attachment-manager.js';
import { saveProfileAvatarArweave } from '../services/user-profile-params.js';
import { openChannelAttachmentManager } from './channel-attachment-manager.js';
import { saveProfileAvatar } from '../services/user-profile-params.js';
export async function openAvatarWizard({
login,
@@ -16,22 +16,20 @@ export async function openAvatarWizard({
throw new Error('Нет активной сессии.');
}
const item = await openArweaveAttachmentManager({
const item = await openChannelAttachmentManager({
login: cleanLogin,
storagePwd: cleanStoragePwd,
gateway: cleanGateway,
navigate,
mode: 'avatar',
historyPurpose: 'avatar',
});
if (!item?.ar || !item?.sha256) return false;
if (!item?.sha256 || !item?.size) return false;
if (typeof onStatus === 'function') {
onStatus('Сохраняем аватар в профиль...');
}
await saveProfileAvatarArweave(cleanLogin, item.ar, item.sha256);
await saveProfileAvatar(cleanLogin, item);
if (typeof onAvatarSaved === 'function') {
await onAvatarSaved(item);