mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 08:03:45 +08:00
chore: remove unused code
This commit is contained in:
parent
cd1d719a92
commit
801b79b728
@ -2,7 +2,6 @@ import useSWR from "swr";
|
||||
import { useRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { SettingsRounded } from "@mui/icons-material";
|
||||
import { checkService } from "@/services/cmds";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { DialogRef, Notice, Switch } from "@/components/base";
|
||||
import { SettingList, SettingItem } from "./mods/setting-comp";
|
||||
@ -19,16 +18,6 @@ const SettingSystem = ({ onError }: Props) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { verge, mutateVerge, patchVerge } = useVerge();
|
||||
// service mode
|
||||
const { data: serviceStatus, mutate: mutateServiceStatus } = useSWR(
|
||||
"checkService",
|
||||
checkService,
|
||||
{
|
||||
revalidateIfStale: false,
|
||||
shouldRetryOnError: false,
|
||||
focusThrottleInterval: 36e5, // 1 hour
|
||||
}
|
||||
);
|
||||
|
||||
const sysproxyRef = useRef<DialogRef>(null);
|
||||
const tunRef = useRef<DialogRef>(null);
|
||||
|
@ -169,18 +169,6 @@ export async function cmdTestDelay(url: string) {
|
||||
return invoke<number>("test_delay", { url });
|
||||
}
|
||||
|
||||
/// service mode
|
||||
|
||||
export async function checkService() {
|
||||
try {
|
||||
const result = await invoke<any>("check_service");
|
||||
if (result?.code === 0) return "active";
|
||||
if (result?.code === 400) return "installed";
|
||||
return "unknown";
|
||||
} catch (err: any) {
|
||||
return "uninstall";
|
||||
}
|
||||
}
|
||||
export async function invoke_uwp_tool() {
|
||||
return invoke<void>("invoke_uwp_tool").catch((err) =>
|
||||
Notice.error(err?.message || err.toString(), 1500),
|
||||
|
Loading…
x
Reference in New Issue
Block a user