From e127a1393ab47af5bd6b124c0c1dd1ac462184ca Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Tue, 12 Sep 2023 12:44:09 +0200 Subject: [PATCH] fix codesmells --- library/src/containers/Sidebar/Sidebar.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index aa3b0534b..92b3d2df8 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -23,11 +23,11 @@ export const Sidebar: React.FunctionComponent = () => { .get('x-logo') ?.value(); const components = asyncapi.components(); - const messages = components && components.messages().all(); - const schemas = components && components.schemas().all(); + const messages = components?.messages().all(); + const schemas = components?.schemas().all(); const hasOperations = asyncapi.operations().length > 0; - const messagesList = messages && messages.length > 0 && ( + const messagesList = messages?.length > 0 && (
  • {
  • ); - const schemasList = schemas && schemas.length > 0 && ( + const schemasList = schemas?.length > 0 && (