forked from platypush/platypush
[UI] Watch the connected
flag for changes to update the Nav indicator.
This commit is contained in:
parent
60b5f235a7
commit
cad36b7911
1 changed files with 4 additions and 5 deletions
|
@ -143,9 +143,7 @@ export default {
|
|||
},
|
||||
|
||||
setConnected(connected) {
|
||||
return () => {
|
||||
this.connected = connected
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -161,8 +159,9 @@ export default {
|
|||
|
||||
mounted() {
|
||||
this.collapsed = this.collapsedDefault
|
||||
bus.on('connect', this.setConnected(true))
|
||||
bus.on('disconnect', this.setConnected(false))
|
||||
bus.on('connect', () => this.setConnected(true))
|
||||
bus.on('disconnect', () => this.setConnected(false))
|
||||
this.$watch(() => this.$root.connected, (value) => this.setConnected(value))
|
||||
this.setConnected(this.$root.connected)
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue