Обновить список каналов и кнопку сообщения

This commit is contained in:
AidarKC
2026-06-24 14:59:08 +04:00
parent 77f5759d60
commit f9a15ab192
7 changed files with 146 additions and 188 deletions
+9 -3
View File
@@ -178,7 +178,11 @@ function allFeedSummaries() {
...(feed.ownedChannels || []),
...(feed.followedUsersChannels || []),
...(feed.followedChannels || []),
];
].filter((summary) => {
const typeCode = Number(summary?.channel?.channelTypeCode ?? 1);
const channelName = String(summary?.channel?.channelName || '').trim().toLowerCase();
return typeCode !== 0 && channelName !== 'stories';
});
}
function resolveChannelDisplayName(channelSelector) {
@@ -394,7 +398,7 @@ function openRepostModal({ navigate, channels = [], onSubmit }) {
.map((item, index) => {
const owner = String(item?.ownerLogin || '').trim();
const name = String(item?.channelName || '').trim();
const label = `${owner || 'my'} / ${name || 'stories'}`;
const label = `${owner || 'my'}/${name || 'channel'}`;
return `<option value="${index}">${label}</option>`;
})
.join('');
@@ -936,10 +940,12 @@ export function render({ navigate, route }) {
return {
ownerLogin: String(row?.channel?.ownerLogin || '').trim(),
channelName: String(row?.channel?.channelName || '').trim(),
channelTypeCode: Number(row?.channel?.channelTypeCode ?? 1),
selector: selectorRow,
};
})
.filter(Boolean);
.filter(Boolean)
.filter((item) => Number(item.channelTypeCode) !== 0 && String(item.channelName || '').trim().toLowerCase() !== 'stories');
if (!channels.length) throw new Error('У вас пока нет каналов для репоста.');
openRepostModal({