+4
-23
@@ -37,7 +37,6 @@ import {
|
||||
type CommandError,
|
||||
type LocalSingBoxStatusResponse,
|
||||
type PingServerResponse,
|
||||
type ProxyTargetCheckResponse,
|
||||
type ProxiFyreSetupStatus,
|
||||
type SingBoxSetupStatus,
|
||||
} from "../api/tauriCommands";
|
||||
@@ -105,9 +104,7 @@ import {
|
||||
routeChainSegments,
|
||||
safeProxyError,
|
||||
pingTone,
|
||||
proxyCheckNoticeKind,
|
||||
proxyCheckNoticeTitle,
|
||||
proxyCheckText,
|
||||
type ProxyCheckResult,
|
||||
changesApplyButtonLabel,
|
||||
routeProxyCheckTarget,
|
||||
profileItemInput,
|
||||
@@ -230,9 +227,7 @@ export function App() {
|
||||
const [serverPings, setServerPings] = useState<
|
||||
Record<string, PingServerResponse>
|
||||
>({});
|
||||
const [proxyCheck, setProxyCheck] = useState<ProxyTargetCheckResponse | null>(
|
||||
null,
|
||||
);
|
||||
const [proxyCheck, setProxyCheck] = useState<ProxyCheckResult | null>(null);
|
||||
const [adminStatus, setAdminStatus] = useState<AdminStatusResponse | null>(
|
||||
null,
|
||||
);
|
||||
@@ -374,7 +369,6 @@ export function App() {
|
||||
singbox,
|
||||
routeMode: savedSnapshot?.routeMode ?? routeMode,
|
||||
singBoxStatus,
|
||||
proxyCheck,
|
||||
artifacts,
|
||||
});
|
||||
|
||||
@@ -1202,11 +1196,7 @@ export function App() {
|
||||
try {
|
||||
target = routeProxyCheckTarget(routeMode, proxyInput, singBoxStatus);
|
||||
} catch (error) {
|
||||
showNotice({
|
||||
kind: "error",
|
||||
title: "Маршрут не проверен",
|
||||
text: errorMessage(error),
|
||||
});
|
||||
setProxyCheck({ failure: errorMessage(error) });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1223,18 +1213,9 @@ export function App() {
|
||||
const result = await pingProxyTarget(target.host, target.port);
|
||||
if (!current()) return;
|
||||
setProxyCheck(result);
|
||||
showNotice({
|
||||
kind: proxyCheckNoticeKind(result),
|
||||
title: proxyCheckNoticeTitle(result),
|
||||
text: proxyCheckText(result),
|
||||
});
|
||||
} catch (error) {
|
||||
if (!current()) return;
|
||||
showNotice({
|
||||
kind: "error",
|
||||
title: "Маршрут не проверен",
|
||||
text: errorMessage(error),
|
||||
});
|
||||
setProxyCheck({ failure: errorMessage(error) });
|
||||
} finally {
|
||||
if (request === probeRequest.current) setIsProxyChecking(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user