Skip to content

Commit

Permalink
Fix associated event types drawer info by checking for -1 (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
karelhala authored Jan 23, 2025
1 parent 60e22c8 commit ed0e9e4
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/components/Integrations/IntegrationsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,20 @@ const IntegrationsDrawer: React.FunctionComponent<IntegrationsDrawerProps> = ({
}
ouiaId={`${ouiaId}-associated-event-types-tab`}
>
{selectedIntegration && selectedIndex && (
<IntegrationEventDetails
id={selectedIntegration?.id}
onEdit={() => {
const editAction = actionResolver(
selectedIntegration,
selectedIndex
).find(({ type }) => type === 'edit');
editAction?.onClick?.();
}}
/>
)}
{selectedIntegration &&
selectedIndex !== undefined &&
selectedIndex !== -1 && (
<IntegrationEventDetails
id={selectedIntegration?.id}
onEdit={() => {
const editAction = actionResolver(
selectedIntegration,
selectedIndex
).find(({ type }) => type === 'edit');
editAction?.onClick?.();
}}
/>
)}
</Tab>
</Tabs>
</DrawerPanelContent>
Expand Down

1 comment on commit ed0e9e4

@karelhala
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest

Please sign in to comment.