mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
9353a6fb00
Co-authored-by: Opender Singh <opender94@gmail.com> Co-authored-by: James Gatz <jamesgatzos@gmail.com>
14 lines
399 B
TypeScript
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]);
|
|
};
|