fix(conversation-assistant): fix Swift compilation errors in APIClient

- Replace force unwrap on non-optional deviceId with if-let pattern
- Remove unused uuidBytes variable declaration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Quinn Ftw 2025-12-28 21:19:50 -08:00
parent 85434d7938
commit 301a0fbc91

View file

@ -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<CFTypeRef>?
let result = IORegistryEntryCreateCFProperty(
service,
"IOPlatformUUID" as CFString,