SHA256
UI: отправка UI-ошибок, персональный публичный чат, русские pending-файлы
This commit is contained in:
@@ -44,17 +44,11 @@ function normalizeLoginInput(value) {
|
||||
|
||||
function buildChannelRouteFromSummary(summary, fallbackId) {
|
||||
const ownerBch = summary?.channel?.ownerBlockchainName;
|
||||
const rootBlockNumber = summary?.channel?.channelRoot?.blockNumber;
|
||||
const rootBlockHash = normalizeHash(summary?.channel?.channelRoot?.blockHash);
|
||||
if (ownerBch && rootBlockNumber != null) {
|
||||
return `channel-view/${encodeRoutePart(ownerBch)}/${Number(rootBlockNumber)}/${rootBlockHash}`;
|
||||
}
|
||||
const ownerLogin = String(summary?.channel?.ownerLogin || '').trim();
|
||||
const channelName = String(summary?.channel?.channelName || '').trim();
|
||||
if (ownerLogin && channelName) {
|
||||
return `channel/${encodeRoutePart(ownerLogin)}/${encodeRoutePart(channelName)}`;
|
||||
if (ownerBch && channelName) {
|
||||
return `channel/${encodeRoutePart(ownerBch)}/${encodeRoutePart(channelName)}`;
|
||||
}
|
||||
return `channel-view/${fallbackId}`;
|
||||
return `channel/${encodeRoutePart(String(summary?.channel?.ownerLogin || '').trim())}/${encodeRoutePart(channelName || fallbackId)}`;
|
||||
}
|
||||
|
||||
function avatarLetterFromName(name = '') {
|
||||
@@ -468,7 +462,8 @@ function openChannelFinderModal({ navigate }) {
|
||||
openBtn.textContent = 'Просмотреть';
|
||||
openBtn.addEventListener('click', () => {
|
||||
close();
|
||||
navigate(`channel/${encodeRoutePart(item.ownerLogin)}/${encodeRoutePart(item.channelName)}`);
|
||||
const ownerPart = String(item.ownerBlockchainName || '').trim() || String(item.ownerLogin || '').trim();
|
||||
navigate(`channel/${encodeRoutePart(ownerPart)}/${encodeRoutePart(item.channelName)}`);
|
||||
});
|
||||
|
||||
row.style.display = 'flex';
|
||||
@@ -487,11 +482,19 @@ function openChannelFinderModal({ navigate }) {
|
||||
const rows = Array.isArray(feed?.ownedChannels) ? feed.ownedChannels : [];
|
||||
const needle = String(filterChannel || '').trim().toLowerCase();
|
||||
const channels = rows
|
||||
.map((item) => String(item?.channel?.channelName || '').trim())
|
||||
.filter(Boolean)
|
||||
.filter((name) => !needle || name.toLowerCase().includes(needle))
|
||||
.map((item) => ({
|
||||
ownerBlockchainName: String(item?.channel?.ownerBlockchainName || '').trim(),
|
||||
channelName: String(item?.channel?.channelName || '').trim(),
|
||||
}))
|
||||
.filter((item) => !!item.channelName)
|
||||
.filter((item) => !needle || item.channelName.toLowerCase().includes(needle))
|
||||
.slice(0, 200)
|
||||
.map((name) => ({ label: `${ownerLogin}/${name}`, ownerLogin, channelName: name }));
|
||||
.map((item) => ({
|
||||
label: `${ownerLogin}/${item.channelName}`,
|
||||
ownerLogin,
|
||||
ownerBlockchainName: item.ownerBlockchainName,
|
||||
channelName: item.channelName,
|
||||
}));
|
||||
renderChannelRows(channels);
|
||||
};
|
||||
|
||||
@@ -550,7 +553,7 @@ function openChannelFinderModal({ navigate }) {
|
||||
function mapMockGroups() {
|
||||
const mapRow = (channel) => ({
|
||||
...channel,
|
||||
route: `channel-view/${channel.id}`,
|
||||
route: `channel/${encodeRoutePart(String(channel.ownerName || 'channel'))}/${encodeRoutePart(String(channel.channelName || channel.title || channel.id))}`,
|
||||
tabCategory: channel.kind === 'own'
|
||||
? 'my'
|
||||
: channel.kind === 'own-personal'
|
||||
@@ -737,7 +740,7 @@ function renderDemoFallback(container, navigate, error, onRetry) {
|
||||
<span class="channel-row-time">—</span>
|
||||
</div>
|
||||
`;
|
||||
row.addEventListener('click', () => navigate(channel.route || `channel-view/${channel.id}`));
|
||||
row.addEventListener('click', () => navigate(channel.route || `channel/${encodeRoutePart(String(channel.ownerName || 'channel'))}/${encodeRoutePart(String(channel.channelName || channel.id))}`));
|
||||
list.append(row);
|
||||
});
|
||||
|
||||
@@ -1012,7 +1015,7 @@ function renderListContent({ screen, container, listState, navigate, refreshFeed
|
||||
controls.append(menuButton, time, count);
|
||||
|
||||
row.append(avatar, main, controls);
|
||||
row.addEventListener('click', () => navigate(channel.route || `channel-view/${channel.id}`));
|
||||
row.addEventListener('click', () => navigate(channel.route || `channel/${encodeRoutePart(String(channel.ownerName || 'channel'))}/${encodeRoutePart(String(channel.channelName || channel.id))}`));
|
||||
list.append(row);
|
||||
});
|
||||
|
||||
@@ -1031,9 +1034,9 @@ function updateBottomCta({ button, listState, navigate, isTabEmpty = false }) {
|
||||
}
|
||||
|
||||
if (tab === 'dialogs') {
|
||||
button.textContent = 'Новый персональный канал';
|
||||
button.textContent = 'Новый персональный публичный чат';
|
||||
button.className = baseClass;
|
||||
button.onclick = () => navigate('add-channel-view');
|
||||
button.onclick = () => navigate('add-personal-public-chat-view');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user