Каналы: создавать профиль одним блоком

This commit is contained in:
AidarKC
2026-08-01 02:19:29 +04:00
parent 8125d1a124
commit 8303682bd7
11 changed files with 201 additions and 118 deletions
+6 -14
View File
@@ -36,7 +36,7 @@ function renderAvatarPreview(slot, avatar, title) {
slot.innerHTML = '';
const wrap = document.createElement('div');
wrap.className = 'channel-profile-avatar';
wrap.style.setProperty('--channel-avatar-size', '82px');
wrap.style.setProperty('--channel-avatar-size', '104px');
if (avatar?.ar) {
const img = document.createElement('img');
img.alt = 'Аватар канала';
@@ -180,25 +180,17 @@ export function render({ navigate }) {
errorEl.textContent = '';
try {
const createResult = await authService.addBlockCreateChannel({
await authService.addBlockCreateChannel({
login,
storagePwd,
channelName: normalizeChannelDisplayName(check.name),
channelDescription: '',
channelDescription: check.description,
channelProfileTitle: check.title,
channelAvatar: selectedAvatar,
channelType: CHANNEL_TYPE_PUBLIC,
channelTypeVersion: 1,
});
if (check.title || check.description || selectedAvatar?.ar) {
await authService.addBlockChannelMeta({
login,
storagePwd,
channel: createResult.channel,
title: check.title,
description: check.description,
avatar: selectedAvatar,
});
if (selectedAvatar?.ar) markArweaveAttachmentPlaced(login, selectedAvatar);
}
if (selectedAvatar?.ar) markArweaveAttachmentPlaced(login, selectedAvatar);
persistCreateSuccessFlash(`Канал "${normalizeChannelDisplayName(check.name)}" создан.`);
navigate('channels-list');