update audio bar only when tablet is shown

This commit is contained in:
Faye Li 2017-01-03 14:37:25 -08:00
parent 752051834d
commit fc186a281f

View file

@ -95,9 +95,11 @@
}
Script.setInterval(function() {
var currentMicLevel = getMicLevel();
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
tablet.updateAudioBar(currentMicLevel);
if (tabletShown) {
var currentMicLevel = getMicLevel();
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
tablet.updateAudioBar(currentMicLevel);
}
}, MIC_LEVEL_UPDATE_INTERVAL_MS);
}()); // END LOCAL_SCOPE