diff --git a/src/core/client/admin/routes/Moderate/Moderate.tsx b/src/core/client/admin/routes/Moderate/Moderate.tsx index 652a7f6bb..9ff64d236 100644 --- a/src/core/client/admin/routes/Moderate/Moderate.tsx +++ b/src/core/client/admin/routes/Moderate/Moderate.tsx @@ -37,18 +37,19 @@ const Moderate: FunctionComponent = ({ const closeModal = useCallback(() => { setShowHotkeysModal(false); }, []); - const toggleModal = useCallback(() => { - setShowHotkeysModal(!showHotkeysModal); - }, [showHotkeysModal]); useEffect(() => { + const toggleModal = () => { + setShowHotkeysModal(was => !was); + }; + // Attach the modal toggle when the GUIDE button is pressed. key(HOTKEYS.GUIDE, toggleModal); return () => { // Detach the modal toggle if we have to rebind it. key.unbind(HOTKEYS.GUIDE); }; - }, [toggleModal]); + }, []); return (