insomnia/packages/insomnia-app/app/ui/hooks/settings-hooks.ts
Dimitri Mitropoulos 9353a6fb00
fixes "Hide menu bar" setting (#3961)
Co-authored-by: Opender Singh <opender94@gmail.com>
Co-authored-by: James Gatz <jamesgatzos@gmail.com>
2021-08-31 16:31:08 +12:00

14 lines
399 B
TypeScript

import { useEffect } from 'react';
import { useSelector } from 'react-redux';
import { setMenuBarVisibility } from '../../common/electron-helpers';
import { selectSettings } from '../redux/selectors';
export const useMenuBarVisibility = () => {
const { autoHideMenuBar } = useSelector(selectSettings);
useEffect(() => {
setMenuBarVisibility(!autoHideMenuBar);
}, [autoHideMenuBar]);
};