feat: press esc hide the window

This commit is contained in:
GyDi 2022-01-13 02:11:50 +08:00
parent 4e8d4f4591
commit 4979a472de

View File

@ -64,6 +64,12 @@ const Layout = () => {
}); });
const [dialogOpen, setDialogOpen] = useState(false); const [dialogOpen, setDialogOpen] = useState(false);
useEffect(() => {
window.addEventListener("keydown", (e) => {
if (e.key === "Escape") windowHide();
});
}, []);
useEffect(() => { useEffect(() => {
if (!vergeConfig) return; if (!vergeConfig) return;
setBlur(!!vergeConfig.theme_blur); setBlur(!!vergeConfig.theme_blur);