Skip to content

Scheduling infrastructure for absolutely everyone.

fix: if we go to event-types/[id]?tabName=apps after installing an app to an organisation it shows 2 apps (#15166)

Amit Sharma29ccc58806c8
diff --git a/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts b/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts
index aa2e5ec6ee8..7f2bd190bb9 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);
+ }
}
});
}