insomnia/packages/insomnia-app/app/ui/hooks/settings-hooks.ts

14 lines
399 B
TypeScript
Raw Normal View History

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]);
};