build: fix build

This commit is contained in:
Haishan 2020-08-01 21:05:45 +08:00
parent 9b3f996c29
commit 941224c13b
2 changed files with 3 additions and 5 deletions

View file

@ -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<VersionData> {
let json = { rules: [] };
let json = {};
try {
const { url, init } = getURLAndInit(apiConfig);
const res = await fetch(url + endpoint, init);

View file

@ -50,12 +50,10 @@ function AboutImpl(props: Props) {
suspense: true,
}
);
console.log(version);
return (
<>
<ContentHeader title="About" />
{version ? (
{version && version.version ? (
<Version
name="Clash"
version={version.version}