mirror of
https://github.com/bolucat/Archive.git
synced 2025-10-05 08:08:03 +08:00
Update On Fri Jun 14 20:33:08 CEST 2024
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user