From 364266da0ae9b07d13ef0f3ff9a5f65baf94c8f4 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 8 Jul 2023 16:19:55 -0700 Subject: [PATCH] fix: :bug: server stats setting, meta fetching --- packages/backend/src/daemons/server-stats.ts | 6 ++++-- packages/client/src/pages/admin/settings.vue | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/daemons/server-stats.ts b/packages/backend/src/daemons/server-stats.ts index ba74278762..42e19d813b 100644 --- a/packages/backend/src/daemons/server-stats.ts +++ b/packages/backend/src/daemons/server-stats.ts @@ -21,8 +21,10 @@ export default function () { ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length || 50)); }); - const meta = fetchMeta(); - if (!meta.enableServerMachineStats) return; + fetchMeta().then((meta) => { + if (!meta.enableServerMachineStats) return; + } + ); async function tick() { const cpu = await cpuUsage(); diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 5108c06965..b03a98ae54 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -468,6 +468,7 @@ let enableIdenticonGeneration: boolean = $ref(false); async function init() { const meta = await os.api("admin/meta"); + if (!meta) throw new Error("No meta"); name = meta.name; description = meta.description; tosUrl = meta.tosUrl;