Skip to content

Commit

Permalink
Not requesting for channels in personal server mode (mattermost-commu…
Browse files Browse the repository at this point in the history
  • Loading branch information
jespino authored Jul 27, 2022
1 parent 3da7ca8 commit 95b65db
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions webapp/src/components/shareBoard/shareBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}}
Expand Down

0 comments on commit 95b65db

Please sign in to comment.