Bot Command Tooltip: Fix flickering when sending command (#1746)

This commit is contained in:
Alexander Zinchuk 2022-03-04 16:21:58 +03:00
parent d65e9937b5
commit 2ce560cf1a

View File

@ -38,7 +38,7 @@ export default function useBotCommandTooltip(
useEffect(() => {
if (!isAllowed || !html.length) {
unmarkIsOpen();
setFilteredBotCommands(undefined);
return;
}
@ -48,7 +48,7 @@ export default function useBotCommandTooltip(
const filter = prepareForRegExp(html.substr(1)).match(RE_COMMAND);
getFilteredCommands(filter ? filter[0] : '');
} else {
unmarkIsOpen();
setFilteredBotCommands(undefined);
}
}, [getFilteredCommands, html, isAllowed, unmarkIsOpen]);