Changeset View
Changeset View
Standalone View
Standalone View
native/community-creation/community-creation-members.react.js
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | [ | ||||
otherUserInfos, | otherUserInfos, | ||||
selectedUserIDs, | selectedUserIDs, | ||||
userSearchIndex, | userSearchIndex, | ||||
usernameInputText, | usernameInputText, | ||||
], | ], | ||||
); | ); | ||||
const onSelectUser = React.useCallback( | const onSelectUser = React.useCallback( | ||||
userID => { | ({ id }: AccountUserInfo) => { | ||||
if (selectedUserIDs.some(existingUserID => userID === existingUserID)) { | if (selectedUserIDs.some(existingUserID => id === existingUserID)) { | ||||
return; | return; | ||||
} | } | ||||
setSelectedUsers(oldUserInfoInputArray => [ | setSelectedUsers(oldUserInfoInputArray => [ | ||||
...oldUserInfoInputArray, | ...oldUserInfoInputArray, | ||||
otherUserInfos[userID], | otherUserInfos[id], | ||||
]); | ]); | ||||
setUsernameInputText(''); | setUsernameInputText(''); | ||||
}, | }, | ||||
[otherUserInfos, selectedUserIDs], | [otherUserInfos, selectedUserIDs], | ||||
); | ); | ||||
const tagInputRef = React.useRef(); | const tagInputRef = React.useRef(); | ||||
Show All 20 Lines |