fix: TUN switch button logical bug
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import { AppDataProvider } from "./providers/app-data-provider";
|
import { AppDataProvider } from "./providers/app-data-provider";
|
||||||
import React from "react";
|
|
||||||
import Layout from "./pages/_layout";
|
import Layout from "./pages/_layout";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|||||||
@@ -39,11 +39,6 @@ const SettingSystem = ({ onError }: Props) => {
|
|||||||
|
|
||||||
const { data: sysproxy } = useSWR("getSystemProxy", getSystemProxy);
|
const { data: sysproxy } = useSWR("getSystemProxy", getSystemProxy);
|
||||||
const { data: autoproxy } = useSWR("getAutotemProxy", getAutotemProxy);
|
const { data: autoproxy } = useSWR("getAutotemProxy", getAutotemProxy);
|
||||||
const { data: autoLaunchEnabled } = useSWR(
|
|
||||||
"getAutoLaunchStatus",
|
|
||||||
getAutoLaunchStatus,
|
|
||||||
{ revalidateOnFocus: false },
|
|
||||||
);
|
|
||||||
|
|
||||||
const { isAdminMode, isSidecarMode, mutateRunningMode, isServiceOk } =
|
const { isAdminMode, isSidecarMode, mutateRunningMode, isServiceOk } =
|
||||||
useSystemState();
|
useSystemState();
|
||||||
@@ -148,7 +143,7 @@ const SettingSystem = ({ onError }: Props) => {
|
|||||||
return patchVerge({ enable_tun_mode: e });
|
return patchVerge({ enable_tun_mode: e });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Switch edge="end" disabled={isServiceOk} />
|
<Switch edge="end" disabled={!isServiceOk} />
|
||||||
</GuardState>
|
</GuardState>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
|
|||||||
Reference in New Issue
Block a user