Skip to content

Commit 9650b69

Browse files
committedJan 14, 2025
fix nits, revert to preview implementations
1 parent 9e0b05b commit 9650b69

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed
 

‎Coder Desktop/Coder Desktop/Coder_DesktopApp.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct DesktopApp: App {
1111
EmptyView()
1212
}
1313
Window("Sign In", id: Windows.login.rawValue) {
14-
LoginForm<CoderClient, SecureSession>()
14+
LoginForm<PreviewClient, PreviewSession>()
1515
}.environmentObject(appDelegate.session)
1616
.windowResizability(.contentSize)
1717
}
@@ -20,17 +20,18 @@ struct DesktopApp: App {
2020
@MainActor
2121
class AppDelegate: NSObject, NSApplicationDelegate {
2222
private var menuBarExtra: FluidMenuBarExtra?
23-
let vpn: CoderVPNService
24-
let session: SecureSession
23+
let vpn: PreviewVPN
24+
let session: PreviewSession
2525

2626
override init() {
27-
vpn = CoderVPNService()
28-
session = SecureSession(onChange: vpn.configureTunnelProviderProtocol)
27+
// TODO: Replace with real implementations
28+
vpn = PreviewVPN()
29+
session = PreviewSession()
2930
}
3031

3132
func applicationDidFinishLaunching(_: Notification) {
3233
menuBarExtra = FluidMenuBarExtra(title: "Coder Desktop", image: "MenuBarIcon") {
33-
VPNMenu<CoderVPNService, SecureSession>().frame(width: 256)
34+
VPNMenu<PreviewVPN, PreviewSession>().frame(width: 256)
3435
.environmentObject(self.vpn)
3536
.environmentObject(self.session)
3637
}

‎Coder Desktop/Coder Desktop/Session.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ protocol Session: ObservableObject {
1212
func tunnelProviderProtocol() -> NETunnelProviderProtocol?
1313
}
1414

15-
class SecureSession: ObservableObject & Session {
15+
class SecureSession: ObservableObject, Session {
1616
let appId = Bundle.main.bundleIdentifier!
1717

1818
// Stored in UserDefaults

‎Coder Desktop/Coder Desktop/SystemExtension.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ extension CoderVPNService: SystemExtensionAsyncRecorder {
8282
class SystemExtensionDelegate<AsyncDelegate: SystemExtensionAsyncRecorder>:
8383
NSObject, OSSystemExtensionRequestDelegate
8484
{
85-
private var logger = Logger(subsystem: "com.coder.Coder-Desktop", category: "vpn-installer")
85+
private var logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "vpn-installer")
8686
private var asyncDelegate: AsyncDelegate
8787

8888
init(asyncDelegate: AsyncDelegate) {
@@ -128,9 +128,8 @@ class SystemExtensionDelegate<AsyncDelegate: SystemExtensionAsyncRecorder>:
128128
actionForReplacingExtension existing: OSSystemExtensionProperties,
129129
withExtension extension: OSSystemExtensionProperties
130130
) -> OSSystemExtensionRequest.ReplacementAction {
131-
// swiftlint: disable line_length
131+
// swiftlint:disable:next line_length
132132
logger.info("Replacing \(request.identifier) v\(existing.bundleShortVersion) with v\(`extension`.bundleShortVersion)")
133-
// swiftlint: enable line_length
134133
return .replace
135134
}
136135
}

‎Coder Desktop/Coder Desktop/VPNService.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ enum VPNServiceError: Error, Equatable {
4242

4343
@MainActor
4444
final class CoderVPNService: NSObject, VPNService {
45-
var logger = Logger(subsystem: "com.coder.Coder-Desktop", category: "vpn")
45+
var logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "vpn")
4646
@Published var tunnelState: VPNServiceState = .disabled
4747
@Published var sysExtnState: SystemExtensionState = .uninstalled
4848
@Published var neState: NetworkExtensionState = .unconfigured

0 commit comments

Comments
 (0)