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');

View File

@@ -15,7 +15,7 @@ html
.x-app#x-app(v-if="appType === '1'" class="x-app-type")
.x-container(style="flex:1")
.x-friend-list(ref="list" style="color:#aaa")
template(v-if="config.minimalFeed")
template(v-if="config && config.minimalFeed")
template(v-for="feed in wristFeed")
.x-friend-item(v-if="feed.type === 'GPS'" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
.detail