From f1fbb35296c289ab73b9fb293eef745a4b8874f72985a3297316983e92c58bf3 Mon Sep 17 00:00:00 2001 From: AidarKC Date: Tue, 19 May 2026 00:41:19 +0300 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D1=8C=20=D0=B2=D0=BA=D0=BB=D0=B0=D0=B4=D0=BA=D1=83=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=D0=BB=D0=BE=D0=B2=20=D0=BF=D0=BE=20=D1=83?= =?UTF-8?q?=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD=D0=B8=D1=8E=20=D0=B8=20?= =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=D0=BE=D0=BB=D0=B2=20owner/channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION.properties | 4 ++-- shine-UI/js/components/toolbar.js | 6 +++--- shine-UI/js/pages/channel-thread-view.js | 20 ++++++++++++++++++++ shine-UI/js/pages/channel-view.js | 20 ++++++++++++++++++++ 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/VERSION.properties b/VERSION.properties index eac0084..d57cdaf 100644 --- a/VERSION.properties +++ b/VERSION.properties @@ -1,2 +1,2 @@ -client.version=1.2.60 -server.version=1.2.54 +client.version=1.2.61 +server.version=1.2.55 diff --git a/shine-UI/js/components/toolbar.js b/shine-UI/js/components/toolbar.js index 67ef9dd..8a6efaf 100644 --- a/shine-UI/js/components/toolbar.js +++ b/shine-UI/js/components/toolbar.js @@ -76,7 +76,7 @@ function installChannelsHoldSwitcher(button, navigate) { let pressed = false; let holdActive = false; let overlay = null; - let selectedMode = 'dialogs'; + let selectedMode = 'feed'; const clearTimer = () => { if (holdTimer) { @@ -120,7 +120,7 @@ function installChannelsHoldSwitcher(button, navigate) { button.addEventListener('pointerdown', (event) => { pressed = true; holdActive = false; - selectedMode = 'dialogs'; + selectedMode = 'feed'; clearTimer(); holdTimer = window.setTimeout(() => { if (!pressed) return; @@ -143,7 +143,7 @@ function installChannelsHoldSwitcher(button, navigate) { navigate(`channels-list/${mode}`); return; } - navigate('channels-list/dialogs'); + navigate('channels-list/feed'); }); button.addEventListener('pointercancel', () => { diff --git a/shine-UI/js/pages/channel-thread-view.js b/shine-UI/js/pages/channel-thread-view.js index e5523a1..af477e1 100644 --- a/shine-UI/js/pages/channel-thread-view.js +++ b/shine-UI/js/pages/channel-thread-view.js @@ -54,6 +54,13 @@ function looksLikeBlockchainName(value) { return /^[^-]+-\d+$/.test(raw); } +function extractLoginFromBlockchainName(value) { + const raw = String(value || '').trim(); + const match = raw.match(/^(.+)-\d+$/); + if (!match) return ''; + return String(match[1] || '').trim(); +} + function makeReactionActionKey(messageRef) { const login = String(state.session.login || '').trim().toLowerCase(); const blockchainName = String(messageRef?.blockchainName || '').trim(); @@ -588,6 +595,7 @@ export function render({ navigate, route }) { ]; const ownerRaw = String(selector.short.ownerBlockchainName || '').trim(); const ownerNormalized = ownerRaw.toLowerCase(); + const ownerLoginFromBch = extractLoginFromBlockchainName(ownerRaw); const channelNameNormalized = String(selector.short.channelName || '').trim().toLowerCase(); let channel = allRows.find((item) => ( String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === ownerNormalized @@ -613,6 +621,18 @@ export function render({ navigate, route }) { // ignore fallback lookup errors } } + if (!channel && ownerLoginFromBch) { + try { + const ownerFeed = await authService.listSubscriptionsFeed(ownerLoginFromBch, 500); + const ownerRows = Array.isArray(ownerFeed?.ownedChannels) ? ownerFeed.ownedChannels : []; + channel = ownerRows.find((item) => ( + String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === ownerNormalized + && String(item?.channel?.channelName || '').trim().toLowerCase() === channelNameNormalized + )); + } catch { + // ignore owner feed lookup errors + } + } const ownerBch = String(channel?.channel?.ownerBlockchainName || '').trim(); const rootNo = Number(channel?.channel?.channelRoot?.blockNumber); const rootHash = normalizeRouteHash(channel?.channel?.channelRoot?.blockHash); diff --git a/shine-UI/js/pages/channel-view.js b/shine-UI/js/pages/channel-view.js index c082b23..b187165 100644 --- a/shine-UI/js/pages/channel-view.js +++ b/shine-UI/js/pages/channel-view.js @@ -60,6 +60,13 @@ function looksLikeBlockchainName(value) { return /^[^-]+-\d+$/.test(raw); } +function extractLoginFromBlockchainName(value) { + const raw = String(value || '').trim(); + const match = raw.match(/^(.+)-\d+$/); + if (!match) return ''; + return String(match[1] || '').trim(); +} + function makeReactionActionKey(messageRef) { const login = String(state.session.login || '').trim().toLowerCase(); const blockchainName = String(messageRef?.blockchainName || '').trim(); @@ -433,6 +440,7 @@ async function loadFromApi(route, channelId) { if (selector?.ownerBlockchainName && selector?.channelName) { const routeOwnerRaw = String(selector.ownerBlockchainName || '').trim(); const routeOwnerNormalized = routeOwnerRaw.toLowerCase(); + const routeOwnerLoginFromBch = extractLoginFromBlockchainName(routeOwnerRaw); const allRows = await getAllRows(); let channel = allRows.find((item) => ( String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === routeOwnerNormalized @@ -458,6 +466,18 @@ async function loadFromApi(route, channelId) { // ignore fallback lookup failures } } + if (!channel && routeOwnerLoginFromBch) { + try { + const ownerFeed = await authService.listSubscriptionsFeed(routeOwnerLoginFromBch, 500); + const ownerRows = Array.isArray(ownerFeed?.ownedChannels) ? ownerFeed.ownedChannels : []; + channel = ownerRows.find((item) => ( + String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === routeOwnerNormalized + && String(item?.channel?.channelName || '').trim().toLowerCase() === selector.channelName.toLowerCase() + )); + } catch { + // ignore owner feed lookup failures + } + } if (!channel?.channel?.ownerBlockchainName || channel?.channel?.channelRoot?.blockNumber == null) { throw new Error('Канал не найден.'); }