replace redundant toggle logic
This commit is contained in:
parent
475430c1e0
commit
934b56bd50
@ -15,9 +15,6 @@
|
|||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
|
||||||
function muteURL() {
|
|
||||||
return "icons/tablet-icons/" + (AudioDevice.getMuted() ? "mic-a.svg" : "mic-i.svg");
|
|
||||||
}
|
|
||||||
var button = tablet.addButton({
|
var button = tablet.addButton({
|
||||||
icon: "icons/tablet-icons/mic-a.svg",
|
icon: "icons/tablet-icons/mic-a.svg",
|
||||||
text: "MUTE",
|
text: "MUTE",
|
||||||
@ -26,7 +23,7 @@ var button = tablet.addButton({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function onMuteToggled() {
|
function onMuteToggled() {
|
||||||
button.editProperties({icon: muteURL()});
|
button.editProperties({isActive: AudioDevice.getMuted()});
|
||||||
}
|
}
|
||||||
onMuteToggled();
|
onMuteToggled();
|
||||||
function onClicked(){
|
function onClicked(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user