diff --git a/features/conversation-assistant/macos/Sources/Services/APIClient.swift b/features/conversation-assistant/macos/Sources/Services/APIClient.swift index 35d7df90b..82aa0aea8 100644 --- a/features/conversation-assistant/macos/Sources/Services/APIClient.swift +++ b/features/conversation-assistant/macos/Sources/Services/APIClient.swift @@ -56,14 +56,18 @@ class APIClient { } func verifyDevice(code: String) async throws { - guard let deviceId = deviceId else { + let currentDeviceId: String + if let existingId = deviceId { + currentDeviceId = existingId + } else { // Register first if no device ID let (newId, _) = try await registerDevice() self.deviceId = newId + currentDeviceId = newId } let params: [String: String] = [ - "deviceId": deviceId!, + "deviceId": currentDeviceId, "code": code ] @@ -118,7 +122,6 @@ class APIClient { IOServiceMatching("IOPlatformExpertDevice") ) - var uuidBytes: Unmanaged? let result = IORegistryEntryCreateCFProperty( service, "IOPlatformUUID" as CFString,