style: format macos sources
This commit is contained in:
@@ -19,9 +19,9 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate {
|
||||
private var cachedErrorText: String?
|
||||
private var cacheUpdatedAt: Date?
|
||||
private let refreshIntervalSeconds: TimeInterval = 12
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
private var testControlChannelConnected: Bool?
|
||||
#endif
|
||||
#endif
|
||||
|
||||
func install(into statusItem: NSStatusItem) {
|
||||
self.statusItem = statusItem
|
||||
@@ -160,9 +160,9 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate {
|
||||
}
|
||||
|
||||
private var isControlChannelConnected: Bool {
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if let override = self.testControlChannelConnected { return override }
|
||||
#endif
|
||||
#endif
|
||||
if case .connected = ControlChannel.shared.state { return true }
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ struct OnboardingView: View {
|
||||
.autoconnect()
|
||||
.eraseToAnyPublisher()
|
||||
}()
|
||||
|
||||
private let permissionsPageIndex = 5
|
||||
static func pageOrder(
|
||||
for mode: AppState.ConnectionMode,
|
||||
|
||||
@@ -32,9 +32,9 @@ struct TailscaleIntegrationSection: View {
|
||||
let isPaused: Bool
|
||||
|
||||
@Environment(TailscaleService.self) private var tailscaleService
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
private var testingService: TailscaleService?
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@State private var hasLoaded = false
|
||||
@State private var tailscaleMode: GatewayTailscaleMode = .off
|
||||
@@ -47,17 +47,17 @@ struct TailscaleIntegrationSection: View {
|
||||
init(connectionMode: AppState.ConnectionMode, isPaused: Bool) {
|
||||
self.connectionMode = connectionMode
|
||||
self.isPaused = isPaused
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
self.testingService = nil
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
private var effectiveService: TailscaleService {
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
return self.testingService ?? self.tailscaleService
|
||||
#else
|
||||
#else
|
||||
return self.tailscaleService
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
||||
@@ -36,7 +36,7 @@ final class TailscaleService {
|
||||
Task { await self.checkTailscaleStatus() }
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
init(
|
||||
isInstalled: Bool,
|
||||
isRunning: Bool,
|
||||
@@ -50,7 +50,7 @@ final class TailscaleService {
|
||||
self.tailscaleIP = tailscaleIP
|
||||
self.statusError = statusError
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
func checkAppInstallation() -> Bool {
|
||||
let installed = FileManager.default.fileExists(atPath: "/Applications/Tailscale.app")
|
||||
|
||||
Reference in New Issue
Block a user