Fix other name showing on typing (#6532)
This commit is contained in:
parent
a18bc6cde1
commit
78f7acde87
1 changed files with 10 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue