Add channel auto-complete.

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

No files matched your search

@@ -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 (
<>