From 97d215e24a56b49c477784e8b5475782fc4c9cd8 Mon Sep 17 00:00:00 2001 From: Heiko Henning Date: Thu, 7 Dec 2023 13:46:45 +0000 Subject: [PATCH 1/2] fix: reply channel displayed correctly --- .../src/containers/Operations/Operation.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/library/src/containers/Operations/Operation.tsx b/library/src/containers/Operations/Operation.tsx index 51ad667d..dce4d0b7 100644 --- a/library/src/containers/Operations/Operation.tsx +++ b/library/src/containers/Operations/Operation.tsx @@ -367,7 +367,7 @@ export const OperationReplyInfo: React.FunctionComponent = props => { showChannel ? 'block' : 'hidden' }`} > - {' '} + {' '} )} @@ -424,11 +424,21 @@ export const OperationReplyInfo: React.FunctionComponent = props => { ); }; -export const OperationChannelInfo: React.FunctionComponent = ({ +export const OperationReplyChannelInfo: React.FunctionComponent = ({ type = PayloadType.SEND, - channelName, - channel, + operation, }) => { + const reply = operation.reply(); + if (reply === undefined) { + return <>; + } + + const channel = reply.channel(); + if (channel === undefined) { + return <>; + } + const channelName = channel?.address() ?? ''; + const config = useConfig(); const servers = typeof channel.servers === 'function' && channel.servers().all(); From 48254818549d78cc8ddf0258aa28afad0b23bac2 Mon Sep 17 00:00:00 2001 From: Heiko Henning Date: Thu, 7 Dec 2023 14:03:26 +0000 Subject: [PATCH 2/2] #855 fix code style --- library/src/containers/Operations/Operation.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/library/src/containers/Operations/Operation.tsx b/library/src/containers/Operations/Operation.tsx index dce4d0b7..5cc36055 100644 --- a/library/src/containers/Operations/Operation.tsx +++ b/library/src/containers/Operations/Operation.tsx @@ -429,23 +429,19 @@ export const OperationReplyChannelInfo: React.FunctionComponent = ({ operation, }) => { const reply = operation.reply(); - if (reply === undefined) { - return <>; - } - const channel = reply.channel(); - if (channel === undefined) { - return <>; - } + const channel = reply?.channel(); + const channelName = channel?.address() ?? ''; const config = useConfig(); const servers = - typeof channel.servers === 'function' && channel.servers().all(); + typeof channel?.servers === 'function' && channel.servers().all(); const parameters = - channel.parameters() !== undefined + channel?.parameters() !== undefined ? SchemaHelpers.parametersToSchema(channel.parameters()) : undefined; + if (!channel) { return <>; }