Skip to content

Commit b86fdac

Browse files
fix: don't show apps when adding participants if the feature was disabled[WPB-22420] (#21123)
1 parent a736212 commit b86fdac

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

apps/webapp/src/script/page/RightSidebar/addParticipants/addParticipants.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import {compareTransliteration, sortByPriority, sortUsersByPriority} from 'Util/
5050
import {getManageServicesUrl} from '../../../externalRoute';
5151
import {PanelHeader} from '../panelHeader';
5252
import {PanelEntity, PanelState} from '../RightSidebar';
53+
import {checkAppsFeatureAvailability} from 'Util/featureUtil';
5354

5455
const ENABLE_ADD_ACTIONS_LENGTH = 0;
5556
const 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

Comments
 (0)