From 95b65dba228b72be005eff27956a57fbf15b643c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 27 Jul 2022 18:50:25 +0200 Subject: [PATCH] Not requesting for channels in personal server mode (#3429) --- .../src/components/shareBoard/shareBoard.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/webapp/src/components/shareBoard/shareBoard.tsx b/webapp/src/components/shareBoard/shareBoard.tsx index 8c5124e76..b2c4ee99e 100644 --- a/webapp/src/components/shareBoard/shareBoard.tsx +++ b/webapp/src/components/shareBoard/shareBoard.tsx @@ -348,14 +348,19 @@ export default function ShareBoardDialog(props: Props): JSX.Element { className={'userSearchInput'} cacheOptions={true} loadOptions={async (inputValue: string) => { - const users = await client.searchTeamUsers(inputValue) - const channels = await client.searchUserChannels(match.params.teamId || '', inputValue) const result = [] - if (users) { - result.push({label: intl.formatMessage({id: 'shareBoard.members-select-group', defaultMessage: 'Members'}), options: users || []}) - } - if (channels) { - result.push({label: intl.formatMessage({id: 'shareBoard.channels-select-group', defaultMessage: 'Channels'}), options: channels || []}) + if (Utils.isFocalboardPlugin()) { + const users = await client.searchTeamUsers(inputValue) + if (users) { + result.push({label: intl.formatMessage({id: 'shareBoard.members-select-group', defaultMessage: 'Members'}), options: users || []}) + } + const channels = await client.searchUserChannels(match.params.teamId || '', inputValue) + if (channels) { + result.push({label: intl.formatMessage({id: 'shareBoard.channels-select-group', defaultMessage: 'Channels'}), options: channels || []}) + } + } else { + const users = await client.searchTeamUsers(inputValue) || [] + result.push(...users) } return result }}