From bd35e991d78432819e95fd07f7b98ec5f671458f Mon Sep 17 00:00:00 2001 From: Imod7 Date: Mon, 15 Jan 2024 11:31:06 +0100 Subject: [PATCH] reintroduced the if statement so that paraId query param works when connected to parachain --- src/services/blocks/XCMDecoder.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/services/blocks/XCMDecoder.ts b/src/services/blocks/XCMDecoder.ts index 8c7cb4b9e..7887c3448 100644 --- a/src/services/blocks/XCMDecoder.ts +++ b/src/services/blocks/XCMDecoder.ts @@ -104,12 +104,22 @@ export class XcmDecoder { data.horizontalMessages.forEach((msgs, index) => { msgs.forEach((msg) => { const xcmMessageDecoded = this.decodeMsg(api, msg.data.slice(1)); - const horizontalMessage: IHorizontalMessage = { - sentAt: msg.sentAt, - paraId: index, - data: xcmMessageDecoded, - }; - xcmMessages.horizontalMessages?.push(horizontalMessage); + let horizontalMessage: IHorizontalMessage; + if (paraId !== undefined && index.toString() === paraId) { + horizontalMessage = { + sentAt: msg.sentAt, + paraId: index, + data: xcmMessageDecoded, + }; + xcmMessages.horizontalMessages?.push(horizontalMessage); + } else if (paraId === undefined) { + horizontalMessage = { + sentAt: msg.sentAt, + paraId: index, + data: xcmMessageDecoded, + }; + xcmMessages.horizontalMessages?.push(horizontalMessage); + } }); }); }