Skip to content

Commit

Permalink
Fix user autocomplete not showing users not in channel (#7980)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9628e15)
  • Loading branch information
larkox authored and mattermost-build committed May 31, 2024
1 parent 9191069 commit c24dde0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/components/autocomplete/at_mention/at_mention.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,14 @@ const AtMention = ({

if (outOfChannel?.length) {
const outChannelMemberIds = outOfChannel.map((e) => e.id);

// This only get us the users we have on the database.
// We need to append those users from which we don't have
// information at the end of the list.
const outSortedMembers = await getUsersFromDMSorted(database, outChannelMemberIds);
sortedMembers.push(...outSortedMembers);
const idSet = new Set(outSortedMembers.map((v) => v.id));
const outRest = outOfChannel.filter((v) => !idSet.has(v.id));
sortedMembers.push(...outSortedMembers, ...outRest);
}

if (hasTrailingSpaces(term)) {
Expand Down

0 comments on commit c24dde0

Please sign in to comment.