fix: round volume values properly
This commit is contained in:
parent
e6d2e891d7
commit
30c2c51828
1 changed files with 2 additions and 10 deletions
|
@ -35,16 +35,8 @@ const SpeakerIndicator = params => Icon({
|
|||
const SpeakerPercentLabel = params => Label({
|
||||
...params,
|
||||
connections: [[Audio, label => {
|
||||
if (!Audio.speaker)
|
||||
return;
|
||||
|
||||
let vol = Math.floor(Audio.speaker.volume * 100);
|
||||
|
||||
if (vol == 0) {
|
||||
label.label = vol + '%';
|
||||
}
|
||||
else {
|
||||
label.label = vol + 1 + '%';
|
||||
if (Audio.speaker) {
|
||||
label.label = Math.round(Audio.speaker.volume * 100) + '%';
|
||||
}
|
||||
}, 'speaker-changed']],
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue