From ed0e9e4874324c876c7e871f121c5f2517ed8d4d Mon Sep 17 00:00:00 2001 From: Karel Hala Date: Thu, 23 Jan 2025 17:04:27 +0100 Subject: [PATCH] Fix associated event types drawer info by checking for -1 (#665) --- .../Integrations/IntegrationsDrawer.tsx | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/Integrations/IntegrationsDrawer.tsx b/src/components/Integrations/IntegrationsDrawer.tsx index 3e9afc9c..d2efde36 100644 --- a/src/components/Integrations/IntegrationsDrawer.tsx +++ b/src/components/Integrations/IntegrationsDrawer.tsx @@ -156,18 +156,20 @@ const IntegrationsDrawer: React.FunctionComponent = ({ } ouiaId={`${ouiaId}-associated-event-types-tab`} > - {selectedIntegration && selectedIndex && ( - { - const editAction = actionResolver( - selectedIntegration, - selectedIndex - ).find(({ type }) => type === 'edit'); - editAction?.onClick?.(); - }} - /> - )} + {selectedIntegration && + selectedIndex !== undefined && + selectedIndex !== -1 && ( + { + const editAction = actionResolver( + selectedIntegration, + selectedIndex + ).find(({ type }) => type === 'edit'); + editAction?.onClick?.(); + }} + /> + )}