Skip to content

Commit

Permalink
fix(contextmenu/item): return to original isEnabled behavior (#2829)
Browse files Browse the repository at this point in the history
  • Loading branch information
rxri authored Feb 14, 2024
1 parent 53b1ff0 commit d8adb2e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions jsHelper/spicetifyWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1556,19 +1556,21 @@ Spicetify.Menu = (() => {

class Item extends Spicetify.ContextMenuV2.Item {
constructor(children, isEnabled, onClick, leadingIcon) {
super({ children, disabled: !isEnabled, leadingIcon, onClick: (_, self) => onClick(self), shouldAdd });
super({ children, leadingIcon, onClick: (_, self) => onClick(self), shouldAdd });

this._isEnabled = isEnabled;
}

setState(state) {
this.isEnabled = state;
this.trailingIcon = this.isEnabled ? "check" : "";
}

set isEnabled(bool) {
this.disabled = !bool;
this._isEnabled = bool;
this.trailingIcon = this.isEnabled ? "check" : "";
}
get isEnabled() {
return !this.disabled;
return this._isEnabled;
}
}

Expand Down

0 comments on commit d8adb2e

Please sign in to comment.