fix(ui-thread): корректные поля channel для GetChannelMessages

This commit is contained in:
AidarKC 2026-05-19 00:42:00 +03:00
parent f1fbb35296
commit 49ebf1605a
2 changed files with 16 additions and 14 deletions

View File

@ -1,2 +1,2 @@
client.version=1.2.61 client.version=1.2.62
server.version=1.2.55 server.version=1.2.56

View File

@ -100,8 +100,8 @@ function parseThreadSelector(route) {
}, },
channel: { channel: {
ownerBlockchainName: '', ownerBlockchainName: '',
rootBlockNumber: null, channelRootBlockNumber: null,
rootBlockHash: '0', channelRootBlockHash: '0',
}, },
}; };
} }
@ -116,8 +116,8 @@ function parseThreadSelector(route) {
}, },
channel: { channel: {
ownerBlockchainName: String(params.channelOwnerBlockchainName || ''), ownerBlockchainName: String(params.channelOwnerBlockchainName || ''),
rootBlockNumber: toSafeInt(params.channelRootBlockNumber), channelRootBlockNumber: toSafeInt(params.channelRootBlockNumber),
rootBlockHash: normalizeRouteHash(params.channelRootBlockHash), channelRootBlockHash: normalizeRouteHash(params.channelRootBlockHash),
}, },
}; };
} }
@ -132,10 +132,12 @@ function allFeedSummaries() {
} }
function resolveChannelDisplayName(channelSelector) { function resolveChannelDisplayName(channelSelector) {
if (!channelSelector?.ownerBlockchainName || channelSelector?.rootBlockNumber == null) return ''; const rootNumber = channelSelector?.channelRootBlockNumber ?? channelSelector?.rootBlockNumber;
const rootHashRaw = channelSelector?.channelRootBlockHash ?? channelSelector?.rootBlockHash;
if (!channelSelector?.ownerBlockchainName || rootNumber == null) return '';
const ownerBch = String(channelSelector.ownerBlockchainName); const ownerBch = String(channelSelector.ownerBlockchainName);
const rootNo = Number(channelSelector.rootBlockNumber); const rootNo = Number(rootNumber);
const rootHash = normalizeRouteHash(channelSelector.rootBlockHash); const rootHash = normalizeRouteHash(rootHashRaw);
const found = allFeedSummaries().find((summary) => ( const found = allFeedSummaries().find((summary) => (
String(summary?.channel?.ownerBlockchainName || '') === ownerBch String(summary?.channel?.ownerBlockchainName || '') === ownerBch
@ -167,15 +169,15 @@ function buildThreadRouteFromTarget(target, selector) {
target.blockNumber, target.blockNumber,
].join('/'); ].join('/');
} }
if (!selector?.channel?.ownerBlockchainName || selector.channel.rootBlockNumber == null) return ''; if (!selector?.channel?.ownerBlockchainName || selector.channel.channelRootBlockNumber == null) return '';
return [ return [
'channel-thread-view', 'channel-thread-view',
encodeRoutePart(target.blockchainName), encodeRoutePart(target.blockchainName),
target.blockNumber, target.blockNumber,
normalizeRouteHash(target.blockHash), normalizeRouteHash(target.blockHash),
encodeRoutePart(selector.channel.ownerBlockchainName), encodeRoutePart(selector.channel.ownerBlockchainName),
selector.channel.rootBlockNumber, selector.channel.channelRootBlockNumber,
normalizeRouteHash(selector.channel.rootBlockHash), normalizeRouteHash(selector.channel.channelRootBlockHash),
].join('/'); ].join('/');
} }
@ -641,8 +643,8 @@ export function render({ navigate, route }) {
} }
selector.channel = { selector.channel = {
ownerBlockchainName: ownerBch, ownerBlockchainName: ownerBch,
rootBlockNumber: rootNo, channelRootBlockNumber: rootNo,
rootBlockHash: rootHash, channelRootBlockHash: rootHash,
}; };
let resolvedHash = normalizeMessageHash(resolvedMessage?.blockHash); let resolvedHash = normalizeMessageHash(resolvedMessage?.blockHash);