diff --git a/src/api/version.ts b/src/api/version.ts index eb8a86c..78ceb83 100644 --- a/src/api/version.ts +++ b/src/api/version.ts @@ -2,7 +2,7 @@ import { getURLAndInit } from 'src/misc/request-helper'; import { ClashAPIConfig } from 'src/types'; type VersionData = { - version: string; + version?: string; premium?: boolean; }; @@ -10,7 +10,7 @@ export async function fetchVersion( endpoint: string, apiConfig: ClashAPIConfig ): Promise { - let json = { rules: [] }; + let json = {}; try { const { url, init } = getURLAndInit(apiConfig); const res = await fetch(url + endpoint, init); diff --git a/src/components/about/About.tsx b/src/components/about/About.tsx index 7648934..0accf12 100644 --- a/src/components/about/About.tsx +++ b/src/components/about/About.tsx @@ -50,12 +50,10 @@ function AboutImpl(props: Props) { suspense: true, } ); - console.log(version); - return ( <> - {version ? ( + {version && version.version ? (