summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorHsiaoyi Hsu <[email protected]>2023-02-19 18:19:09 +0800
committerkunish <[email protected]>2023-02-19 18:39:27 +0800
commit74cd574e731fe494758dd78d2f08db66ee6840b5 (patch)
treebe958852926cce8292baca8c01d25e7bdedbe738 /src/components
parent61e5e67735f77921443f2326323226eb82e00b25 (diff)
fix: getLatencyTestUrl, encode healthcheckProvider name
Diffstat (limited to 'src/components')
-rw-r--r--src/components/proxies/ProxyGroup.tsx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/components/proxies/ProxyGroup.tsx b/src/components/proxies/ProxyGroup.tsx
index cc290d0..fb97e28 100644
--- a/src/components/proxies/ProxyGroup.tsx
+++ b/src/components/proxies/ProxyGroup.tsx
@@ -4,7 +4,12 @@ import { useQuery } from 'react-query';
import * as proxiesAPI from '~/api/proxies';
import { fetchVersion } from '~/api/version';
-import { getCollapsibleIsOpen, getHideUnavailableProxies, getProxySortBy } from '~/store/app';
+import {
+ getCollapsibleIsOpen,
+ getHideUnavailableProxies,
+ getLatencyTestUrl,
+ getProxySortBy,
+} from '~/store/app';
import { fetchProxies, getProxies, switchProxy } from '~/store/proxies';
import Button from '../Button';
@@ -34,6 +39,7 @@ function ProxyGroupImpl({
type,
now,
isOpen,
+ latencyTestUrl,
apiConfig,
dispatch,
}) {
@@ -69,7 +75,7 @@ function ProxyGroupImpl({
setIsTestingLatency(true);
try {
if (version.meta === true) {
- await proxiesAPI.requestDelayForProxyGroup(apiConfig, name);
+ await proxiesAPI.requestDelayForProxyGroup(apiConfig, name, latencyTestUrl);
await dispatch(fetchProxies(apiConfig));
} else {
await requestDelayForProxies(apiConfig, all);
@@ -113,6 +119,7 @@ export const ProxyGroup = connect((s, { name, delay }) => {
const collapsibleIsOpen = getCollapsibleIsOpen(s);
const proxySortBy = getProxySortBy(s);
const hideUnavailableProxies = getHideUnavailableProxies(s);
+ const latencyTestUrl = getLatencyTestUrl(s);
const group = proxies[name];
const { all, type, now } = group;
@@ -125,5 +132,6 @@ export const ProxyGroup = connect((s, { name, delay }) => {
type,
now,
isOpen: collapsibleIsOpen[`proxyGroup:${name}`],
+ latencyTestUrl,
};
})(ProxyGroupImpl);