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