summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/proxies/ProxyGroup.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/components/proxies/ProxyGroup.tsx b/src/components/proxies/ProxyGroup.tsx
index 49ba2e7..c098b32 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 * as proxiesAPI from '$src/api/proxies';
import { getCollapsibleIsOpen, getHideUnavailableProxies, getProxySortBy } from '$src/store/app';
@@ -15,6 +18,7 @@ import { ProxyList, ProxyListSummaryView } from './ProxyList';
const { createElement, useCallback, useMemo, useState } = React;
+
function ZapWrapper() {
return (
<div className={s0.zapWrapper}>
@@ -44,7 +48,12 @@ 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 },
// proxies: { requestDelayForProxyGroup },