fix: TUN switch button logical bug

This commit is contained in:
Tunglies
2025-05-13 01:11:20 +08:00
parent c2c46d1cae
commit 6578cd8c51
2 changed files with 2 additions and 8 deletions

View File

@@ -1,5 +1,4 @@
import { AppDataProvider } from "./providers/app-data-provider";
import React from "react";
import Layout from "./pages/_layout";
function App() {
@@ -10,4 +9,4 @@ function App() {
);
}
export default App;
export default App;

View File

@@ -39,11 +39,6 @@ const SettingSystem = ({ onError }: Props) => {
const { data: sysproxy } = useSWR("getSystemProxy", getSystemProxy);
const { data: autoproxy } = useSWR("getAutotemProxy", getAutotemProxy);
const { data: autoLaunchEnabled } = useSWR(
"getAutoLaunchStatus",
getAutoLaunchStatus,
{ revalidateOnFocus: false },
);
const { isAdminMode, isSidecarMode, mutateRunningMode, isServiceOk } =
useSystemState();
@@ -148,7 +143,7 @@ const SettingSystem = ({ onError }: Props) => {
return patchVerge({ enable_tun_mode: e });
}}
>
<Switch edge="end" disabled={isServiceOk} />
<Switch edge="end" disabled={!isServiceOk} />
</GuardState>
</SettingItem>
<SettingItem