mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
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]);
|
||
|
};
|