From cad36b791177774f19e5ed10631813b2b0f8299d Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 12 Nov 2023 13:55:37 +0100 Subject: [PATCH] [UI] Watch the `connected` flag for changes to update the Nav indicator. --- platypush/backend/http/webapp/src/components/Nav.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/Nav.vue b/platypush/backend/http/webapp/src/components/Nav.vue index da7cd133e..3bc47878e 100644 --- a/platypush/backend/http/webapp/src/components/Nav.vue +++ b/platypush/backend/http/webapp/src/components/Nav.vue @@ -143,9 +143,7 @@ export default { }, setConnected(connected) { - return () => { - this.connected = connected - } + 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) }, }