chore: revert

This commit is contained in:
huzibaca
2024-10-06 01:09:59 +08:00
parent 5fdb52d8d0
commit c5eacd1627
2 changed files with 57 additions and 20 deletions

View File

@@ -67,9 +67,20 @@ const SettingSystem = ({ onError }: Props) => {
onCatch={onError}
onFormat={onSwitchFormat}
onChange={(e) => {
onChangeData({ enable_tun_mode: e });
if (serviceStatus !== "active") {
onChangeData({ enable_tun_mode: false });
} else {
onChangeData({ enable_tun_mode: e });
}
}}
onGuard={(e) => {
if (serviceStatus !== "active" && e) {
Notice.error(t("Please Enable Service Mode"));
return Promise.resolve();
} else {
return patchVerge({ enable_tun_mode: e });
}
}}
onGuard={(e) => patchVerge({ enable_tun_mode: e })}
>
<Switch edge="end" />
</GuardState>