diff --git a/src/components/services/AdGuardHome.vue b/src/components/services/AdGuardHome.vue index 91d5b42..103dba8 100644 --- a/src/components/services/AdGuardHome.vue +++ b/src/components/services/AdGuardHome.vue @@ -51,21 +51,27 @@ export default { }, }, created: function () { + // Set up auto-update method for the scheduler + this.autoUpdateMethod = this.fetchStatus; + + // Initial data fetch this.fetchStatus(); - if (!this.item.subtitle) { - this.fetchStats(); - } }, methods: { fetchStatus: async function () { - this.status = await this.fetch("/control/status").catch((e) => - console.log(e), - ); - }, - fetchStats: async function () { - this.stats = await this.fetch("/control/stats").catch((e) => - console.log(e), - ); + this.fetch("/control/status") + .then((status) => { + this.status = status; + }) + .catch((e) => console.log(e)); + + if (!this.item.subtitle) { + this.fetch("/control/stats") + .then((stats) => { + this.stats = stats; + }) + .catch((e) => console.log(e)); + } }, }, };