From a1559540ecf8a17b534a5edfc12194dedb84e345 Mon Sep 17 00:00:00 2001 From: stuartforrest-infinity <49638642+stuartforrest-infinity@users.noreply.github.com> Date: Wed, 6 Oct 2021 11:55:03 +0100 Subject: [PATCH] fix: render the `uid` for all messages in a channel (#175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Maciej UrbaƄczyk --- components/Channels.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/components/Channels.js b/components/Channels.js index b60863e11..c9b7b541d 100644 --- a/components/Channels.js +++ b/components/Channels.js @@ -56,8 +56,25 @@ function Parameters({ parameters }) { ); } +function OperationMessages({ messages }) { + return ( + <> + {messages.length > 1 && + + Accepts **one of** the following messages: + + } + {messages.map(msg => ( + + )) + } + + ) +} + function Operation({ operation }) { const type = operation.isPublish() ? 'publish' : 'subscribe'; + const hasMessages = operation.hasMultipleMessages() || !!operation.message(0); return (
{`\`${type}\` Operation`}
@@ -71,17 +88,8 @@ function Operation({ operation }) { {operation.description()}
)} - {operation.hasMultipleMessages() ? ( - <> - - Accepts **one of** the following messages: - - {operation.messages().map(msg => ( - - ))} - - ) : ( - + {hasMessages && ( + )} );