Bot Command Tooltip: Fix flickering (again) (#1788)

This commit is contained in:
Alexander Zinchuk 2022-03-25 13:15:03 +01:00
parent a6a7f6d84f
commit 998a082b4e

View File

@ -53,12 +53,12 @@ export default function useBotCommandTooltip(
}, [getFilteredCommands, html, isAllowed, unmarkIsOpen]); }, [getFilteredCommands, html, isAllowed, unmarkIsOpen]);
useEffect(() => { useEffect(() => {
if (filteredBotCommands && filteredBotCommands.length) { if (filteredBotCommands && filteredBotCommands.length && html.length > 0) {
markIsOpen(); markIsOpen();
} else { } else {
unmarkIsOpen(); unmarkIsOpen();
} }
}, [filteredBotCommands, markIsOpen, unmarkIsOpen]); }, [filteredBotCommands, html.length, markIsOpen, unmarkIsOpen]);
return { return {
isOpen, isOpen,