forked from platypush/platypush
[UI] Expose the connected
flag on the root element level.
This commit is contained in:
parent
4c0e3a16b6
commit
5c22271e88
2 changed files with 4 additions and 0 deletions
|
@ -32,6 +32,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
config: {},
|
config: {},
|
||||||
userAuthenticated: false,
|
userAuthenticated: false,
|
||||||
|
connected: false,
|
||||||
pwaInstallEvent: null,
|
pwaInstallEvent: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -97,6 +98,8 @@ export default {
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
bus.onNotification(this.onNotification)
|
bus.onNotification(this.onNotification)
|
||||||
|
bus.on('connect', () => this.connected = true)
|
||||||
|
bus.on('disconnect', () => this.connected = false)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -163,6 +163,7 @@ export default {
|
||||||
this.collapsed = this.collapsedDefault
|
this.collapsed = this.collapsedDefault
|
||||||
bus.on('connect', this.setConnected(true))
|
bus.on('connect', this.setConnected(true))
|
||||||
bus.on('disconnect', this.setConnected(false))
|
bus.on('disconnect', this.setConnected(false))
|
||||||
|
this.setConnected(this.$root.connected)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue