Skip to content
Snippets Groups Projects
Unverified Commit 8c8171e7 authored by GyDi's avatar GyDi
Browse files

feat: change default latency test url

parent 0bb17902
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
SortByAlphaRounded, SortByAlphaRounded,
SortRounded, SortRounded,
} from "@mui/icons-material"; } from "@mui/icons-material";
import { useVergeConfig } from "@/hooks/use-verge-config";
import delayManager from "@/services/delay"; import delayManager from "@/services/delay";
import type { HeadState } from "./use-head-state"; import type { HeadState } from "./use-head-state";
import type { ProxySortType } from "./use-filter-sort"; import type { ProxySortType } from "./use-filter-sort";
...@@ -41,9 +42,14 @@ const ProxyHead = (props: Props) => { ...@@ -41,9 +42,14 @@ const ProxyHead = (props: Props) => {
return () => clearTimeout(timer); return () => clearTimeout(timer);
}, []); }, []);
const { data: vergeConfig } = useVergeConfig();
useEffect(() => { useEffect(() => {
delayManager.setUrl(groupName, testUrl); delayManager.setUrl(
}, [groupName, headState.testUrl]); groupName,
testUrl || vergeConfig?.default_latency_test!
);
}, [groupName, testUrl, vergeConfig?.default_latency_test]);
return ( return (
<Box sx={{ display: "flex", alignItems: "center", ...sx }}> <Box sx={{ display: "flex", alignItems: "center", ...sx }}>
......
...@@ -81,6 +81,9 @@ const MiscViewer = ({ handler }: Props) => { ...@@ -81,6 +81,9 @@ const MiscViewer = ({ handler }: Props) => {
<TextField <TextField
size="small" size="small"
autoComplete="off" autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
sx={{ width: 200 }} sx={{ width: 200 }}
value={values.defaultLatencyTest} value={values.defaultLatencyTest}
placeholder="http://www.gstatic.com/generate_204" placeholder="http://www.gstatic.com/generate_204"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment