From 4b95f238678cfec83b29f2bdad87098ac3992f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E5=B0=8F=E9=99=8C?= Date: Sat, 11 May 2024 11:59:51 +0800 Subject: [PATCH] no message --- app/components/settings.tsx | 2 +- app/store/access.ts | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 501c222..c47b29b 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -626,7 +626,7 @@ export function Settings() { const showUsage = accessStore.isAuthorized(); useEffect(() => { // checks per minutes - checkUpdate(); + // checkUpdate(); showUsage && checkUsage(); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/app/store/access.ts b/app/store/access.ts index 6884e71..f850baa 100644 --- a/app/store/access.ts +++ b/app/store/access.ts @@ -82,7 +82,7 @@ export const useAccessStore = createPersistStore( fetch() { if (fetchState > 0 || getClientConfig()?.buildMode === "export") return; fetchState = 1; - fetch("/api/config", { + fetch("https://app.gter.net/ai/config", { method: "post", body: null, headers: { @@ -90,9 +90,10 @@ export const useAccessStore = createPersistStore( }, }) .then((res) => res.json()) - .then((res: DangerConfig) => { - console.log("[Config] got config from server", res); - set(() => ({ ...res })); + .then((res) => { + var config = res.data; + console.log("[Config] got config from server", config); + set(() => ({ ...config })); }) .catch(() => { console.error("[Config] failed to fetch config");