mirror of
https://github.com/zen-browser/desktop.git
synced 2026-08-19 13:11:31 +00:00
chore: Change zap button behavior
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user