From 8f7752a0b8e13cc003a6addb7d9b615fbd7d3dbe Mon Sep 17 00:00:00 2001 From: Emily Wotruba Date: Tue, 21 May 2024 20:49:59 +0200 Subject: [PATCH] wait for `fetchServerStatus` before calling `fetchServerStats` --- src/components/services/HomeAssistant.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/services/HomeAssistant.vue b/src/components/services/HomeAssistant.vue index f43bf98..f9bec72 100644 --- a/src/components/services/HomeAssistant.vue +++ b/src/components/services/HomeAssistant.vue @@ -80,14 +80,14 @@ export default { }, }, created() { - this.fetchServerStatus(); - - if (!this.item.subtitle && this.status !== "dead") { - if (!this.item.items) this.item.items = ["name", "version"]; - if (!this.item.separator) this.item.separator = " "; - if (!this.item.logo) this.item.logo = `${this.item.url}/static/icons/favicon-192x192.png`; - this.fetchServerStats(); - } + this.fetchServerStatus().then(() => { + if (!this.item.subtitle && this.status !== "dead") { + if (!this.item.items) this.item.items = ["name", "version"]; + if (!this.item.separator) this.item.separator = " "; + if (!this.item.logo) this.item.logo = `${this.item.url}/static/icons/favicon-192x192.png`; + this.fetchServerStats(); + } + }); }, methods: { fetchServerStatus: async function () {