From f1342c15284e0408f11095e6d3e1e9842e0318c8 Mon Sep 17 00:00:00 2001 From: Yuns Date: Fri, 22 Mar 2024 22:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20no=20monitorHistoryData?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/+data.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/index/+data.ts b/src/pages/index/+data.ts index 0196382..da82391 100644 --- a/src/pages/index/+data.ts +++ b/src/pages/index/+data.ts @@ -11,7 +11,12 @@ export async function data(pageContext: PageContext) { try { const { allMonitors, kvData } = await getCoreData(useRemoteMonitors) - const { lastUpdate, monitorHistoryData = {} } = kvData + const { lastUpdate, monitorHistoryData } = kvData + + if (!monitorHistoryData) { + return kvData + } + return { allMonitors, kvData: {