From 5c22271e88be55474f206746bc7a0f105ae8394b Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 23 Oct 2023 15:03:36 +0200 Subject: [PATCH] [UI] Expose the `connected` flag on the root element level. --- platypush/backend/http/webapp/src/App.vue | 3 +++ platypush/backend/http/webapp/src/components/Nav.vue | 1 + 2 files changed, 4 insertions(+) diff --git a/platypush/backend/http/webapp/src/App.vue b/platypush/backend/http/webapp/src/App.vue index ce8171f007..8a8699a601 100644 --- a/platypush/backend/http/webapp/src/App.vue +++ b/platypush/backend/http/webapp/src/App.vue @@ -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) }, } diff --git a/platypush/backend/http/webapp/src/components/Nav.vue b/platypush/backend/http/webapp/src/components/Nav.vue index ebdee69131..f012705a7f 100644 --- a/platypush/backend/http/webapp/src/components/Nav.vue +++ b/platypush/backend/http/webapp/src/components/Nav.vue @@ -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) }, }