Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Fixed home toggle showing window while being disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixeluted committed Apr 21, 2024
1 parent a15318a commit 94ed1a2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/assets/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 94ed1a2

Please sign in to comment.