1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-07-06 23:36:34 +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

View File

@ -348,14 +348,19 @@ export default function ShareBoardDialog(props: Props): JSX.Element {
className={'userSearchInput'} className={'userSearchInput'}
cacheOptions={true} cacheOptions={true}
loadOptions={async (inputValue: string) => { loadOptions={async (inputValue: string) => {
const users = await client.searchTeamUsers(inputValue)
const channels = await client.searchUserChannels(match.params.teamId || '', inputValue)
const result = [] const result = []
if (users) { if (Utils.isFocalboardPlugin()) {
result.push({label: intl.formatMessage({id: 'shareBoard.members-select-group', defaultMessage: 'Members'}), options: users || []}) const users = await client.searchTeamUsers(inputValue)
} if (users) {
if (channels) { result.push({label: intl.formatMessage({id: 'shareBoard.members-select-group', defaultMessage: 'Members'}), options: users || []})
result.push({label: intl.formatMessage({id: 'shareBoard.channels-select-group', defaultMessage: 'Channels'}), options: channels || []}) }
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 return result
}} }}