chore: Change zap button behavior

This commit is contained in:
FlorianButz
2026-04-12 19:11:05 +02:00
parent 2657357276
commit 7d904f0a39
3 changed files with 10 additions and 3 deletions

View File

@@ -461,9 +461,12 @@ ${cssSelector} {
const actor =
linkedBrowser.browsingContext.currentWindowGlobal.getActor("ZenBoosts");
const zapButton = this.doc.getElementById("zen-boost-zap");
const zapEnabled = await actor.sendQuery("ZenBoost:ZapModeEnabled");
// Checks if there are any zaps
const zapAny = await actor.sendQuery("ZenBoost:ZapModeAny");
zapButton.setAttribute("enabled", zapEnabled ? "true" : "false");
zapButton.setAttribute("enabled", (zapEnabled || zapAny) ? "true" : "false");
}
async onUpdatePickerButtonVisual() {
@@ -1295,6 +1298,7 @@ ${cssSelector} {
this.updateDot();
this.updateCircleRadius();
this.onUpdateZapValue();
this.onUpdateZapButtonVisual();
}
/**

View File

@@ -262,6 +262,9 @@ export class ZenBoostsChild extends JSWindowActorChild {
break;
case "ZenBoost:ZapModeEnabled":
return this.#currentState === ZenBoostsChild.STATES.ZAP;
case "ZenBoost:ZapModeAny":
const { boostData } = (await this.getWebsiteBoost()).boostEntry;
return boostData.zapSelectors.length > 0;
case "ZenBoost:SelectorPickerModeEnabled":
return this.#currentState === ZenBoostsChild.STATES.PICKER;
case "ZenBoost:OpenInspector":

View File

@@ -534,11 +534,11 @@ body {
}
.zen-boost-font-button-active {
background-color: #5454572f !important;
background-color: #5454572f;
}
.zen-boost-font-button-active:hover {
background-color: #5b5b5c28 !important;
background-color: #5b5b5c28;
}
@property --mod-button-c1 {