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