fix(thread): открывать ответ через channel-thread-view с hash
This commit is contained in:
parent
580bd6fbeb
commit
d13c60fca1
@ -1,2 +1,2 @@
|
||||
client.version=1.2.63
|
||||
server.version=1.2.57
|
||||
client.version=1.2.64
|
||||
server.version=1.2.58
|
||||
|
||||
@ -161,24 +161,25 @@ function buildBackRoute(selector) {
|
||||
|
||||
function buildThreadRouteFromTarget(target, selector) {
|
||||
if (!target) return '';
|
||||
if (selector?.short?.ownerBlockchainName && selector?.short?.channelName) {
|
||||
return [
|
||||
'channel',
|
||||
encodeRoutePart(selector.short.ownerBlockchainName),
|
||||
encodeRoutePart(selector.short.channelName),
|
||||
target.blockNumber,
|
||||
].join('/');
|
||||
}
|
||||
if (!selector?.channel?.ownerBlockchainName || selector.channel.channelRootBlockNumber == null) return '';
|
||||
return [
|
||||
const ownerBch = String(selector?.channel?.ownerBlockchainName || '').trim();
|
||||
const rootNo = Number(selector?.channel?.channelRootBlockNumber);
|
||||
const rootHash = normalizeRouteHash(selector?.channel?.channelRootBlockHash);
|
||||
const base = [
|
||||
'channel-thread-view',
|
||||
encodeRoutePart(target.blockchainName),
|
||||
target.blockNumber,
|
||||
normalizeRouteHash(target.blockHash),
|
||||
encodeRoutePart(selector.channel.ownerBlockchainName),
|
||||
selector.channel.channelRootBlockNumber,
|
||||
normalizeRouteHash(selector.channel.channelRootBlockHash),
|
||||
].join('/');
|
||||
];
|
||||
|
||||
if (ownerBch && Number.isFinite(rootNo) && rootNo >= 0) {
|
||||
base.push(
|
||||
encodeRoutePart(ownerBch),
|
||||
String(rootNo),
|
||||
normalizeRouteHash(rootHash),
|
||||
);
|
||||
}
|
||||
|
||||
return base.join('/');
|
||||
}
|
||||
|
||||
function buildTargetFromNode(node) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user