1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-23 18:34:02 +02:00

Not requesting for channels in personal server mode (#3429)

This commit is contained in:
Jesús Espino 2022-07-27 18:50:25 +02:00 committed by GitHub
parent 3da7ca8e74
commit 95b65dba22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}}