diff --git a/frontend/web/components/modals/CreateSegmentUsersTabContent.tsx b/frontend/web/components/modals/CreateSegmentUsersTabContent.tsx index 6357716dad16..5b10da5e69a8 100644 --- a/frontend/web/components/modals/CreateSegmentUsersTabContent.tsx +++ b/frontend/web/components/modals/CreateSegmentUsersTabContent.tsx @@ -93,12 +93,14 @@ const CreateSegmentUsersTabContent: React.FC< pages: undefined, }) }} - onRefresh={() => { - if (!environmentId) return - identities?.results.forEach((identity) => - AppActions.getIdentitySegments(projectId, identity.id), - ) - }} + onRefresh={ + environmentId + ? () => + identities?.results.forEach((identity) => + AppActions.getIdentitySegments(projectId, identity.id), + ) + : undefined + } renderRow={( { id, identifier }: { id: string; identifier: string }, index: number,