Skip to content

Commit

Permalink
improve: get bypass state before build menu
Browse files Browse the repository at this point in the history
  • Loading branch information
remisiki committed Jul 13, 2024
1 parent a20a435 commit 4d5d5ee
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,15 @@ const EEPSIndicator = GObject.registerClass(
// Build menu with last values
this._buildMenu(this.categoryNames[0], this.categoryNames[1], this.command);

// Get global bypass
try {
const bypassResponse = await this.execCommunicate(this.command.concat(["-b", "3"]));
this.enableBypass = (bypassResponse.trim() === "1");
} catch (err) {
Main.notify(_("An error occurred while trying to get global bypass"), _(`Error:\n\n${err}`));
logError(err);
}

// Try to get Last used presets
let erMessage = 'An error occurred while trying to get last presets';
try {
Expand Down Expand Up @@ -392,11 +401,6 @@ const EEPSIndicator = GObject.registerClass(
Main.notify(_(erMessage), _(`Error:\n\n${e}`));
logError(e);
}

// Get global bypass
const bypassResponse = await this.execCommunicate(this.command.concat(["-b", "3"]));
const bypassEnabled = (bypassResponse.trim() === "1")
this.enableBypass = bypassEnabled;
}
}

Expand Down

0 comments on commit 4d5d5ee

Please sign in to comment.