Fix other name showing on typing (#6532)

This commit is contained in:
Daniel Espino García
2022-08-02 19:01:45 +02:00
committed by GitHub
parent a18bc6cde1
commit 78f7acde87

View File

@@ -96,7 +96,7 @@ function Typing({
} else if (mounted.current) {
setRefresh(Date.now());
}
}, []);
}, [channelId, rootId]);
useEffect(() => {
mounted.current = true;
@@ -123,6 +123,15 @@ function Typing({
typingHeight.value = typing.current.length ? TYPING_HEIGHT : 0;
}, [refresh]);
useEffect(() => {
typing.current = [];
typingHeight.value = 0;
if (timeoutToDisappear.current) {
clearTimeout(timeoutToDisappear.current);
timeoutToDisappear.current = undefined;
}
}, [channelId, rootId]);
const renderTyping = () => {
const nextTyping = typing.current.map(({username}) => username);