mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-18 09:52:13 +08:00
fix(service): avoid sticky availability probes
This commit is contained in:
@@ -4,7 +4,6 @@ import {
|
||||
getRunningMode,
|
||||
getServiceInstallState,
|
||||
isAdmin,
|
||||
isServiceAvailable,
|
||||
type RunningMode,
|
||||
type ServiceInstallState,
|
||||
} from '@/services/cmds'
|
||||
@@ -29,17 +28,15 @@ const defaultSystemState = {
|
||||
} as SystemState
|
||||
|
||||
export const fetchSystemState = async (): Promise<SystemState> => {
|
||||
const [runningMode, isAdminMode, isServiceOk, serviceInstallState] =
|
||||
await Promise.all([
|
||||
getRunningMode(),
|
||||
isAdmin(),
|
||||
isServiceAvailable(),
|
||||
getServiceInstallState().catch(() => null),
|
||||
])
|
||||
const [runningMode, isAdminMode, serviceInstallState] = await Promise.all([
|
||||
getRunningMode(),
|
||||
isAdmin(),
|
||||
getServiceInstallState().catch(() => null),
|
||||
])
|
||||
return {
|
||||
runningMode,
|
||||
isAdminMode,
|
||||
isServiceOk,
|
||||
isServiceOk: serviceInstallState === 'ready',
|
||||
serviceInstallState,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user