build: fix build
This commit is contained in:
parent
9b3f996c29
commit
941224c13b
2 changed files with 3 additions and 5 deletions
|
@ -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);
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in a new issue