Add channel auto-complete.

This commit is contained in:
Paul
2021-06-22 13:35:43 +01:00
parent f724cfdf4f
commit feaec3f8d9
2 changed files with 97 additions and 19 deletions

View File

@@ -227,7 +227,11 @@ function MessageBox({ channel, draft, dispatcher }: Props) {
}
const debouncedStopTyping = useCallback(debounce(stopTyping, 1000), [ channel._id ]);
const { onChange, onKeyUp, onKeyDown, onFocus, onBlur, ...autoCompleteProps } = useAutoComplete(setMessage, { users: { type: 'channel', id: channel._id } });
const { onChange, onKeyUp, onKeyDown, onFocus, onBlur, ...autoCompleteProps } =
useAutoComplete(setMessage, {
users: { type: 'channel', id: channel._id },
channels: channel.channel_type === 'TextChannel' ? { server: channel.server } : undefined
});
return (
<>