diff --git a/webapp/components/suggestion/switch_channel_provider.jsx b/webapp/components/suggestion/switch_channel_provider.jsx index 8412332ea1..346721cd66 100644 --- a/webapp/components/suggestion/switch_channel_provider.jsx +++ b/webapp/components/suggestion/switch_channel_provider.jsx @@ -121,7 +121,11 @@ export default class SwitchChannelProvider extends Provider { } async fetchUsersAndChannels(channelPrefix, suggestionId) { - const usersAsync = Client4.autocompleteUsers(channelPrefix, '', ''); + let teamId = ''; + if (global.window.mm_config.RestrictDirectMessage === 'team') { + teamId = store.getState().entities.teams.currentTeamId; + } + const usersAsync = Client4.autocompleteUsers(channelPrefix, teamId, ''); const channelsAsync = Client4.searchChannels(getCurrentTeamId(getState()), channelPrefix); let usersFromServer = [];