From 29ccc58806c8337bc19653d2e108dc54d33fab47 Mon Sep 17 00:00:00 2001 From: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Date: Thu, 23 May 2024 14:07:10 +0530 Subject: [PATCH] fix: if we go to event-types/[id]?tabName=apps after installing an app to an organisation it shows 2 apps (#15166) Co-authored-by: Somay Chauhan --- .../server/routers/loggedInViewer/integrations.handler.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts b/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts index aa2e5ec6ee..7f2bd190bb 100644 --- a/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts +++ b/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts @@ -111,7 +111,10 @@ export const integrationsHandler = async ({ ctx, input }: IntegrationsOptions) = if (team?.parent) { const { parent, ...filteredTeam } = team; filteredTeams.push(filteredTeam); - parentTeams.push(parent); + // Only add parent team if it's not already in teamsQuery + if (!teamsQuery.some((t) => t.id === parent.id)) { + parentTeams.push(parent); + } } }); }