From 941224c13ba87d2c3f36fb86652f046a5c76e00d Mon Sep 17 00:00:00 2001 From: Haishan Date: Sat, 1 Aug 2020 21:05:45 +0800 Subject: [PATCH] build: fix build --- src/api/version.ts | 4 ++-- src/components/about/About.tsx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) 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 ? (