@@ -50,6 +50,7 @@ import {compareTransliteration, sortByPriority, sortUsersByPriority} from 'Util/
5050import { getManageServicesUrl } from '../../../externalRoute' ;
5151import { PanelHeader } from '../panelHeader' ;
5252import { PanelEntity , PanelState } from '../RightSidebar' ;
53+ import { checkAppsFeatureAvailability } from 'Util/featureUtil' ;
5354
5455const ENABLE_ADD_ACTIONS_LENGTH = 0 ;
5556const ENABLE_IS_SEARCHING_LENGTH = 0 ;
@@ -102,7 +103,12 @@ const AddParticipants: FC<AddParticipantsProps> = ({
102103 'isTeamOnly' ,
103104 'participating_user_ids' ,
104105 ] ) ;
105- const { isTeam, teamMembers, teamUsers} = useKoSubscribableChildren ( teamState , [ 'isTeam' , 'teamMembers' , 'teamUsers' ] ) ;
106+ const { isTeam, teamMembers, teamUsers, isAppsEnabled} = useKoSubscribableChildren ( teamState , [
107+ 'isTeam' ,
108+ 'teamMembers' ,
109+ 'teamUsers' ,
110+ 'isAppsEnabled' ,
111+ ] ) ;
106112 const { connectedUsers} = useKoSubscribableChildren ( userState , [ 'connectedUsers' ] ) ;
107113 const { teamRole} = useKoSubscribableChildren ( selfUser , [ 'teamRole' ] ) ;
108114 const { services} = useKoSubscribableChildren ( integrationRepository , [ 'services' ] ) ;
@@ -150,7 +156,13 @@ const AddParticipants: FC<AddParticipantsProps> = ({
150156 const isService = ! ! firstUserEntity ?. isService ;
151157 const allowIntegrations = isGroupOrChannel || isService ;
152158
153- return isTeam && allowIntegrations && inTeam && ! isTeamOnly && isServicesEnabled ;
159+ // Don't allow new apps to be added if the feature has been disabled
160+ const isAppFeatureEnabled = checkAppsFeatureAvailability ( {
161+ protocol : activeConversation . protocol ,
162+ isAppsEnabled : isAppsEnabled ,
163+ } ) ;
164+
165+ return isTeam && allowIntegrations && inTeam && ! isTeamOnly && isServicesEnabled && isAppFeatureEnabled ;
154166 } , [
155167 firstUserEntity ?. isService ,
156168 inTeam ,
0 commit comments