Changeset View
Changeset View
Standalone View
Standalone View
native/chat/compose-subchannel.react.js
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | const onSelectExistingThread = React.useCallback( | ||||
(threadID: string) => { | (threadID: string) => { | ||||
const threadInfo = threadInfos[threadID]; | const threadInfo = threadInfos[threadID]; | ||||
navigateToThread({ threadInfo }); | navigateToThread({ threadInfo }); | ||||
}, | }, | ||||
[threadInfos, navigateToThread], | [threadInfos, navigateToThread], | ||||
); | ); | ||||
const onUserSelect = React.useCallback( | const onUserSelect = React.useCallback( | ||||
(userID: string) => { | ({ id }: AccountUserInfo) => { | ||||
if (userInfoInputIDs.some(existingUserID => userID === existingUserID)) { | if (userInfoInputIDs.some(existingUserID => id === existingUserID)) { | ||||
return; | return; | ||||
} | } | ||||
setUserInfoInputArray(oldUserInfoInputArray => [ | setUserInfoInputArray(oldUserInfoInputArray => [ | ||||
...oldUserInfoInputArray, | ...oldUserInfoInputArray, | ||||
otherUserInfos[userID], | otherUserInfos[id], | ||||
]); | ]); | ||||
setUsernameInputText(''); | setUsernameInputText(''); | ||||
}, | }, | ||||
[userInfoInputIDs, otherUserInfos], | [userInfoInputIDs, otherUserInfos], | ||||
); | ); | ||||
const styles = useStyles(unboundStyles); | const styles = useStyles(unboundStyles); | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |