Skip to content

Commit

Permalink
Indicators: Show indicator only when gicon is assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
maniacx committed Feb 21, 2024
1 parent dc07c9e commit 40a5227
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/airpodTrayIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class AirpodIndicator extends QuickSettings.SystemIndicator {
this._modelIcon = model.icon;
this._multipleInfo = model.multipleInfo;
this._indicator = this._addIndicator();
this._indicator.visible = false;
this.updateInfo(data);
}

Expand Down Expand Up @@ -111,12 +112,15 @@ class AirpodIndicator extends QuickSettings.SystemIndicator {
const leftLevel = data.leftStatus || data.leftLevel === -1 ? 101 : data.leftLevel;
const rightLevel = data.rightStatus || data.rightLevel === -1 ? 101 : data.rightLevel;
const percent = leftLevel < rightLevel ? leftLevel : rightLevel;
if (percent !== 101)
if (percent !== 101) {
this._indicator.gicon = this._getGicon(percent);
this._indicator.visible = true;
}
}
} else if (data.singleLevel !== -2) {
const percent = data.singleLevel;
this._indicator.gicon = this._getGicon(percent);
this._indicator.visible = true;
}
}
});
Expand Down

0 comments on commit 40a5227

Please sign in to comment.