Fix config error from vr.js running before app,js config is initialized

This commit is contained in:
Natsumi
2021-01-22 21:04:43 +13:00
parent cd3406ac19
commit 571ebf8f99
2 changed files with 8 additions and 7 deletions

View File

@@ -727,9 +727,13 @@ speechSynthesis.getVoices();
$app.methods.updateVRConfigVars = function () {
var newConfig = sharedRepository.getObject('VRConfigVars');
if ((newConfig) && (JSON.stringify(newConfig) !== JSON.stringify(this.config))) {
this.config = newConfig;
this.lastFeedEntry = [];
if (newConfig) {
if (JSON.stringify(newConfig) !== JSON.stringify(this.config)) {
this.config = newConfig;
this.lastFeedEntry = [];
}
} else {
throw 'config not set';
}
};
@@ -770,9 +774,6 @@ speechSynthesis.getVoices();
$app.methods.updateLoop = async function () {
try {
this.updateVRConfigVars();
if (!this.config) {
return;
}
this.currentTime = new Date().toJSON();
this.currentUserStatus = sharedRepository.getString('current_user_status');
this.isGameRunning = sharedRepository.getBool('is_game_running');