diff options
| author | Matain <[email protected]> | 2022-06-09 17:47:00 +0800 |
|---|---|---|
| committer | Matain <[email protected]> | 2022-06-09 17:47:00 +0800 |
| commit | 1ae70e1368bc5b0dc99aa92cb993721cef3fe09a (patch) | |
| tree | b6f8ac54b92205aec5c65acec4fe4cf546cbb3e4 /src/components | |
| parent | 6a266db1dc3377c96f587fda731c49cb9acf4e3f (diff) | |
add the groupproxy delay test(no problem)
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/proxies/ProxyGroup.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/proxies/ProxyGroup.tsx b/src/components/proxies/ProxyGroup.tsx index c098b32..2b00bae 100644 --- a/src/components/proxies/ProxyGroup.tsx +++ b/src/components/proxies/ProxyGroup.tsx @@ -2,11 +2,10 @@ 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 { fetchVersion } from '$src/api/version'; import { getCollapsibleIsOpen, getHideUnavailableProxies, getProxySortBy } from '$src/store/app'; -import { getProxies, switchProxy } from '$src/store/proxies'; +import { fetchProxies, getProxies, switchProxy } from '$src/store/proxies'; import Button from '../Button'; import CollapsibleSectionHeader from '../CollapsibleSectionHeader'; @@ -52,7 +51,7 @@ function ProxyGroupImpl({ fetchVersion('/version',apiConfig) ); - const isSelectable = useMemo(() => ['Selector', version.meta && 'Fallback'].includes(type) , [type]); + const isSelectable = useMemo(() => ['Selector', version.meta && 'Fallback'].includes(type) , [type, version.meta]); const { app: { updateCollapsibleIsOpen }, @@ -75,9 +74,10 @@ function ProxyGroupImpl({ setIsTestingLatency(true); try { await proxiesAPI.requestDelayForProxyGroup(apiConfig,name); + await dispatch(fetchProxies(apiConfig)); } catch (err) {} setIsTestingLatency(false); - }, [apiConfig, name]); + }, [apiConfig, dispatch, name]); return ( <div className={s0.group}> |
