Skip to content

Commit

Permalink
Make Vue.mounted async so spectrum displays at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
GlassOnTin committed Aug 4, 2024
1 parent e3e5fc4 commit cc99df8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions radiacode_examples/webserver_logger.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
padding: 0;
margin-left: 20px;
}
#debug-output {
#status-output {
margin-top: 20px;
border: 1px solid #ccc;
padding: 10px;
Expand Down Expand Up @@ -64,8 +64,8 @@
<button @click="requestNotificationPermission">Enable Notifications</button>
</div>

<div id="debug-output">
<h3>Debug Output:</h3>
<div id="status-output">
<h3>Status Output:</h3>
<p>Notification Permission: {{ notificationPermission }}</p>
<p>Latest Count Rate: {{ latestCountRate }} CPS</p>
<p>Threshold: {{ notificationThreshold }} CPS</p>
Expand Down Expand Up @@ -286,9 +286,10 @@ <h3>Debug Output:</h3>
this.rates_autoupdate = !this.rates_autoupdate;
}
},
mounted() {
async mounted() {
this.initWebSocket();
this.checkNotificationPermission();
await this.updateSpectrum(); // Call updateSpectrum at startup
},
beforeDestroy() {
if (this.socket) {
Expand Down

0 comments on commit cc99df8

Please sign in to comment.