mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-15 19:22:26 +08:00
fix: check service
This commit is contained in:
parent
8342f985e5
commit
ad1a057edb
|
@ -41,8 +41,11 @@ export const ServiceViewer = forwardRef<DialogRef, Props>((props, ref) => {
|
|||
const onInstall = useLockFn(async () => {
|
||||
try {
|
||||
await installService();
|
||||
mutateCheck();
|
||||
await mutateCheck();
|
||||
setOpen(false);
|
||||
setTimeout(() => {
|
||||
mutateCheck();
|
||||
}, 2000);
|
||||
Notice.success(t("Service Installed Successfully"));
|
||||
} catch (err: any) {
|
||||
mutateCheck();
|
||||
|
|
|
@ -4,6 +4,7 @@ import { checkService } from "@/services/cmds";
|
|||
import { useVerge } from "@/hooks/use-verge";
|
||||
import getSystem from "@/utils/get-system";
|
||||
import useSWR from "swr";
|
||||
import { useEffect } from "react";
|
||||
|
||||
const isWIN = getSystem() === "windows";
|
||||
|
||||
|
@ -17,7 +18,7 @@ export const StackModeSwitch = (props: Props) => {
|
|||
const { verge } = useVerge();
|
||||
const { enable_service_mode } = verge ?? {};
|
||||
// service mode
|
||||
const { data: serviceStatus } = useSWR(
|
||||
const { data: serviceStatus, mutate: mutateCheck } = useSWR(
|
||||
isWIN ? "checkService" : null,
|
||||
checkService,
|
||||
{
|
||||
|
@ -28,6 +29,10 @@ export const StackModeSwitch = (props: Props) => {
|
|||
|
||||
const { t } = useTranslation();
|
||||
|
||||
useEffect(() => {
|
||||
mutateCheck();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
title={
|
||||
|
|
Loading…
Reference in New Issue
Block a user