summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorMetaCubeX <[email protected]>2022-06-04 01:07:54 +0800
committerMetaCubeX <[email protected]>2022-06-04 01:07:54 +0800
commitde0930aba4957bcba8ce867012b9a6dd87cb9e2b (patch)
tree50a40aaa960c4c80477fd863abc375d88754b83a /src/components
parent91bfabd5d231df21003f09f49e897b9a5bfc57d7 (diff)
chore: Determine whether FALLBACK is optional based on the core
Diffstat (limited to 'src/components')
-rw-r--r--src/components/proxies/ProxyGroup.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/proxies/ProxyGroup.tsx b/src/components/proxies/ProxyGroup.tsx
index c835d7e..8998f27 100644
--- a/src/components/proxies/ProxyGroup.tsx
+++ b/src/components/proxies/ProxyGroup.tsx
@@ -1,5 +1,8 @@
import * as React from 'react';
import { Zap } from 'react-feather';
+import { useQuery } from 'react-query';
+
+import { fetchVersion } from '$src/api/version';
import {
getCollapsibleIsOpen,
@@ -16,6 +19,7 @@ import { ProxyList, ProxyListSummaryView } from './ProxyList';
const { createElement, useCallback, useMemo, useState } = React;
+
function ZapWrapper() {
return (
<div className={s0.zapWrapper}>
@@ -45,7 +49,11 @@ function ProxyGroupImpl({
proxies
);
- const isSelectable = useMemo(() => ['Selector', 'Fallback'].includes(type) , [type]);
+ const { data: version } = useQuery(['/version', apiConfig], () =>
+ fetchVersion('/version',apiConfig)
+ );
+
+ const isSelectable = useMemo(() => ['Selector', version.meta && 'Fallback'].includes(type) , [type]);
const {
app: { updateCollapsibleIsOpen },