Merge pull request #4 from stossy11/main

Fix App Name Instead of Bundle ID
This commit is contained in:
Stephen 2025-03-27 15:44:40 -04:00 • committed by GitHub
commit 5233d86fdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -147,17 +147,17 @@ class InstalledAppsViewModel: ObservableObject {
return
}
if output.hasPrefix("{\"error\":") {
self.apps = [:]
}
print(output)
// Decode the JSON into a Swift dictionary
do {
let decoder = JSONDecoder()
let apps = try decoder.decode([String: String].self, from: jsonData)
self.apps = apps
if let app = apps.first, app.key == "error" {
self.apps = [:]
} else {
self.apps = apps
}
return
} catch {
print("Error: Failed to decode JSON - \(error)")