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'; import { ClashAPIConfig } from 'src/types';
type VersionData = { type VersionData = {
version: string; version?: string;
premium?: boolean; premium?: boolean;
}; };
@ -10,7 +10,7 @@ export async function fetchVersion(
endpoint: string, endpoint: string,
apiConfig: ClashAPIConfig apiConfig: ClashAPIConfig
): Promise<VersionData> { ): Promise<VersionData> {
let json = { rules: [] }; let json = {};
try { try {
const { url, init } = getURLAndInit(apiConfig); const { url, init } = getURLAndInit(apiConfig);
const res = await fetch(url + endpoint, init); const res = await fetch(url + endpoint, init);

View file

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