2025-12-20 14:46:53 +00:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
|
|
enum GatewayAutostartPolicy {
|
|
|
|
|
static func shouldStartGateway(mode: AppState.ConnectionMode, paused: Bool) -> Bool {
|
|
|
|
|
mode == .local && !paused
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static func shouldEnsureLaunchAgent(
|
|
|
|
|
mode: AppState.ConnectionMode,
|
|
|
|
|
paused: Bool,
|
2025-12-20 19:48:53 +01:00
|
|
|
attachExistingOnly: Bool) -> Bool
|
2025-12-20 19:01:59 +01:00
|
|
|
{
|
2025-12-20 19:48:53 +01:00
|
|
|
self.shouldStartGateway(mode: mode, paused: paused) && !attachExistingOnly
|
2025-12-20 14:46:53 +00:00
|
|
|
}
|
|
|
|
|
}
|