Skip to content

Commit b20523b

Browse files
committed
Read build info from BuildInfo component if set
1 parent 2a987a9 commit b20523b

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

etc/js/app.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,17 @@ Promise.all(components).then((values) => {
259259
this.app_state.bytes.received = this.conn.bytes.received;
260260
this.app_state.has3DCanvas = flecs.has3DCanvas;
261261

262-
if (msg.components && msg.components["flecs.stats.WorldSummary"]) {
263-
const summary = msg.components["flecs.stats.WorldSummary"];
264-
this.app_state.world_info = summary;
265-
this.app_state.build_info = summary.build_info;
262+
if (msg.components) {
263+
if (msg.components["flecs.stats.WorldSummary"]) {
264+
const summary = msg.components["flecs.stats.WorldSummary"];
265+
this.app_state.world_info = summary;
266+
this.app_state.build_info = summary.build_info;
267+
}
268+
269+
const buildInfo = msg.components["flecs.core.BuildInfo"];
270+
if (buildInfo) {
271+
this.app_state.build_info = buildInfo;
272+
}
266273
}
267274
}.bind(this)
268275
});

etc/js/components/widgets/info-bar/info-build-config.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ const props = defineProps({
1515
});
1616
1717
const config = computed(() => {
18-
const wi = props.app_state.world_info;
19-
if (!wi) {
20-
return {};
21-
}
22-
23-
const bi = wi.build_info;
18+
const bi = props.app_state.build_info;
2419
if (bi) {
2520
if (bi.sanitize) {
2621
return "sanitize";
@@ -30,7 +25,7 @@ const config = computed(() => {
3025
return "release";
3126
}
3227
} else {
33-
return undefined;
28+
return "unknown"
3429
}
3530
});
3631

etc/js/components/widgets/info-bar/info-build-version.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,11 @@ const props = defineProps({
1414
});
1515
1616
const version = computed(() => {
17-
const wi = props.app_state.world_info;
18-
if (!wi) {
19-
return "?.?.?";
20-
}
21-
22-
const bi = wi.build_info;
17+
const bi = props.app_state.build_info;
2318
if (bi) {
2419
return bi.version;
2520
} else {
26-
return undefined;
21+
return "?.?.?";
2722
}
2823
});
2924

0 commit comments

Comments
 (0)