SHA256
UI: отключение вкладки чатов и исправление загрузки каналов
This commit is contained in:
@@ -49,6 +49,11 @@ function toSafeInt(value) {
|
||||
return Number.isFinite(parsed) ? parsed : null;
|
||||
}
|
||||
|
||||
function looksLikeBlockchainName(value) {
|
||||
const raw = String(value || '').trim();
|
||||
return /^[^-]+-\d+$/.test(raw);
|
||||
}
|
||||
|
||||
function makeReactionActionKey(messageRef) {
|
||||
const login = String(state.session.login || '').trim().toLowerCase();
|
||||
const blockchainName = String(messageRef?.blockchainName || '').trim();
|
||||
@@ -581,10 +586,33 @@ export function render({ navigate, route }) {
|
||||
...(Array.isArray(ownFeed?.followedUsersChannels) ? ownFeed.followedUsersChannels : []),
|
||||
...(Array.isArray(ownFeed?.followedChannels) ? ownFeed.followedChannels : []),
|
||||
];
|
||||
const channel = allRows.find((item) => (
|
||||
String(item?.channel?.ownerBlockchainName || '').trim() === selector.short.ownerBlockchainName
|
||||
&& String(item?.channel?.channelName || '').trim().toLowerCase() === selector.short.channelName.toLowerCase()
|
||||
const ownerRaw = String(selector.short.ownerBlockchainName || '').trim();
|
||||
const ownerNormalized = ownerRaw.toLowerCase();
|
||||
const channelNameNormalized = String(selector.short.channelName || '').trim().toLowerCase();
|
||||
let channel = allRows.find((item) => (
|
||||
String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === ownerNormalized
|
||||
&& String(item?.channel?.channelName || '').trim().toLowerCase() === channelNameNormalized
|
||||
));
|
||||
if (!channel) {
|
||||
channel = allRows.find((item) => (
|
||||
String(item?.channel?.ownerLogin || '').trim().toLowerCase() === ownerNormalized
|
||||
&& String(item?.channel?.channelName || '').trim().toLowerCase() === channelNameNormalized
|
||||
));
|
||||
}
|
||||
if (!channel && !looksLikeBlockchainName(ownerRaw)) {
|
||||
try {
|
||||
const ownerUser = await authService.getUser(ownerRaw);
|
||||
const ownerBch = String(ownerUser?.blockchainName || '').trim().toLowerCase();
|
||||
if (ownerBch) {
|
||||
channel = allRows.find((item) => (
|
||||
String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === ownerBch
|
||||
&& String(item?.channel?.channelName || '').trim().toLowerCase() === channelNameNormalized
|
||||
));
|
||||
}
|
||||
} catch {
|
||||
// ignore fallback lookup errors
|
||||
}
|
||||
}
|
||||
const ownerBch = String(channel?.channel?.ownerBlockchainName || '').trim();
|
||||
const rootNo = Number(channel?.channel?.channelRoot?.blockNumber);
|
||||
const rootHash = normalizeRouteHash(channel?.channel?.channelRoot?.blockHash);
|
||||
|
||||
Reference in New Issue
Block a user