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 <[email protected]>
This commit is contained in:
Amit SharmaandSomay Chauhan authored and GitHub committed 2024-05-23 08:37:10 +00:00
1 parent 26bd02bd94
commit 29ccc58806
1 file changed
+4 -1
@@ -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);
}
}
});
}