Skip to content

Commit

Permalink
Merge pull request #867 from The-Commit-Company/856-raven-should-not-…
Browse files Browse the repository at this point in the history
…allow-the-admin-to-search-for-and-select-the-same-user-multiple-times-in-the-channel-if-they-have-already-been-selected

fix: filter selected users in dropdown
  • Loading branch information
nikkothari22 authored Apr 12, 2024
2 parents 610f634 + b2c21e8 commit 14db6e1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ const AddMembersDropdown = ({ channelMembers, label = 'Select users', selectedUs
const lowerCasedInputValue = inputValue.toLowerCase()

return nonChannelMembers.filter((user: UserFields) => {
const isUserSelected = selectedUsers.find(selectedUser => selectedUser.name === user.name)
return (
!selectedUsers.includes(user) &&
!isUserSelected &&
(user.full_name.toLowerCase().includes(lowerCasedInputValue) ||
user.name.toLowerCase().includes(lowerCasedInputValue))
)
Expand Down

0 comments on commit 14db6e1

Please sign in to comment.