Merge pull request #9317 from druiz17/tabletBug

Fixed interface crashing when bring up tablet
This commit is contained in:
Seth Alves 2017-01-05 14:26:00 -08:00 committed by GitHub
commit 907ffd7e98

View file

@ -46,6 +46,12 @@
}
function updateShowTablet() {
if (tabletShown) {
var currentMicLevel = getMicLevel();
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
tablet.updateAudioBar(currentMicLevel);
}
if (HMD.showTablet && !tabletShown) {
showTabletUI();
} else if (!HMD.showTablet && tabletShown) {
@ -60,8 +66,7 @@
Messages.subscribe("toggleHand");
Messages.messageReceived.connect(toggleHand);
Script.update.connect(updateShowTablet);
// Script.setInterval(updateShowTablet, 1000);
Script.setInterval(updateShowTablet, 100);
// Initialise variables used to calculate audio level
var accumulatedLevel = 0.0;
@ -90,12 +95,5 @@
return micLevel;
}
Script.setInterval(function() {
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