summaryrefslogtreecommitdiff
path: root/src/components/APIDiscovery.tsx
diff options
context:
space:
mode:
authorHaishan <[email protected]>2022-06-05 23:40:25 +0800
committerHaishan <[email protected]>2022-06-05 23:40:25 +0800
commit6a402afa3f16b8cc00a939b72250b5aaabaf5b7d (patch)
treeefe062a5847c6ef950d56aef3165842f829de119 /src/components/APIDiscovery.tsx
parentdadca39e95c17d9c6182038e659f1a07ff71c55c (diff)
Fix theme switcher button shape on iOS
Diffstat (limited to 'src/components/APIDiscovery.tsx')
-rw-r--r--src/components/APIDiscovery.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/components/APIDiscovery.tsx b/src/components/APIDiscovery.tsx
index f34c886..d211e04 100644
--- a/src/components/APIDiscovery.tsx
+++ b/src/components/APIDiscovery.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import { ThemeSwitcher } from 'src/components/shared/ThemeSwitcher';
-import { DOES_NOT_SUPPORT_FETCH, errors } from 'src/misc/errors';
+import { DOES_NOT_SUPPORT_FETCH, errors, YacdError } from 'src/misc/errors';
import { getClashAPIConfig } from 'src/store/app';
import { fetchConfigs } from 'src/store/configs';
import { closeModal } from 'src/store/modals';
@@ -16,9 +16,7 @@ const { useCallback, useEffect } = React;
function APIDiscovery({ dispatch, apiConfig, modals }) {
if (!window.fetch) {
const { detail } = errors[DOES_NOT_SUPPORT_FETCH];
- const err = new Error(detail);
- // @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
- err.code = DOES_NOT_SUPPORT_FETCH;
+ const err = new YacdError(detail, DOES_NOT_SUPPORT_FETCH);
throw err;
}