From 94ed1a267141fb71bcc3418e45ae5821f53bb677 Mon Sep 17 00:00:00 2001 From: Pixeluted Date: Sun, 21 Apr 2024 21:51:55 +0200 Subject: [PATCH] Fixed home toggle showing window while being disabled --- src/assets/scripts/main.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/assets/scripts/main.js b/src/assets/scripts/main.js index b60212b..225bbcc 100644 --- a/src/assets/scripts/main.js +++ b/src/assets/scripts/main.js @@ -71,9 +71,18 @@ async function hide(onlyAnimation) { else toggleLock = false; } -async function toggle(force) { - if (await isVisible() && (force || settings.keyToggle)) await hide(); - else await show(); +async function toggle(ignoreKeyToggle) { + let isWindowVisible = await isVisible(); + let isKeyToggleEnabled = settings.keyToggle; + let actionCanBeTaken = (ignoreKeyToggle === true || isKeyToggleEnabled === true) + + if (actionCanBeTaken === false) return; + + if (isWindowVisible) { + await hide() + } else { + await show() + } } async function exit() {