Update On Fri Jun 14 20:33:08 CEST 2024

This commit is contained in:
github-action[bot]
2024-06-14 20:33:08 +02:00
parent c66b76b626
commit b730d8852b
209 changed files with 11720 additions and 7494 deletions

View File

@@ -22,11 +22,15 @@ const SettingSystem = ({ onError }: Props) => {
const { verge, mutateVerge, patchVerge } = useVerge();
// service mode
const { data: serviceStatus } = useSWR("checkService", checkService, {
revalidateIfStale: false,
shouldRetryOnError: false,
focusThrottleInterval: 36e5, // 1 hour
});
const { data: serviceStatus, mutate: mutateCheck } = useSWR(
"checkService",
checkService,
{
revalidateIfStale: false,
shouldRetryOnError: false,
focusThrottleInterval: 36e5, // 1 hour
}
);
const serviceRef = useRef<DialogRef>(null);
const sysproxyRef = useRef<DialogRef>(null);
@@ -84,7 +88,7 @@ const SettingSystem = ({ onError }: Props) => {
onChange={(e) => onChangeData({ enable_tun_mode: e })}
onGuard={(e) => patchVerge({ enable_tun_mode: e })}
>
<Switch edge="end" />
<Switch disabled={serviceStatus !== "active"} edge="end" />
</GuardState>
</SettingItem>
@@ -109,7 +113,10 @@ const SettingSystem = ({ onError }: Props) => {
onCatch={onError}
onFormat={onSwitchFormat}
onChange={(e) => onChangeData({ enable_service_mode: e })}
onGuard={(e) => patchVerge({ enable_service_mode: e })}
onGuard={(e) => {
setTimeout(() => mutateCheck(), 1000);
return patchVerge({ enable_service_mode: e });
}}
>
<Switch
edge="end"