[UI] Expose the connected flag on the root element level.

This commit is contained in:
Fabio Manganiello 2023-10-23 15:03:36 +02:00
parent 4c0e3a16b6
commit 5c22271e88
Signed by: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 4 additions and 0 deletions

View file

@ -32,6 +32,7 @@ export default {
return {
config: {},
userAuthenticated: false,
connected: false,
pwaInstallEvent: null,
}
},
@ -97,6 +98,8 @@ export default {
mounted() {
bus.onNotification(this.onNotification)
bus.on('connect', () => this.connected = true)
bus.on('disconnect', () => this.connected = false)
},
}
</script>

View file

@ -163,6 +163,7 @@ export default {
this.collapsed = this.collapsedDefault
bus.on('connect', this.setConnected(true))
bus.on('disconnect', this.setConnected(false))
this.setConnected(this.$root.connected)
},
}
</script>