mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Properly filter in more channels search (#6513)
This commit is contained in:
committed by
Christopher Speller
parent
2f88bcb223
commit
1c9ec861fd
@@ -43,6 +43,8 @@ import {
|
||||
deleteChannel as deleteChannelRedux
|
||||
} from 'mattermost-redux/actions/channels';
|
||||
|
||||
import {getMyChannelMemberships} from 'mattermost-redux/selectors/entities/channels';
|
||||
|
||||
export function goToChannel(channel) {
|
||||
if (channel.fake) {
|
||||
const user = UserStore.getProfileByUsername(channel.display_name);
|
||||
@@ -294,7 +296,9 @@ export function searchMoreChannels(term, success, error) {
|
||||
searchChannels(TeamStore.getCurrentId(), term)(dispatch, getState).then(
|
||||
(data) => {
|
||||
if (data && success) {
|
||||
success(data);
|
||||
const myMembers = getMyChannelMemberships(getState());
|
||||
const channels = data.filter((c) => !myMembers[c.id]);
|
||||
success(channels);
|
||||
} else if (data == null && error) {
|
||||
const serverError = getState().requests.channels.getChannels.error;
|
||||
error({id: serverError.server_error_id, ...serverError});
|
||||
|
||||
Reference in New Issue
Block a user