mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 12:30:29 +00:00
Merge pull request #4 from stossy11/main
Fix App Name Instead of Bundle ID
This commit is contained in:
commit
5233d86fdd
1 changed files with 5 additions and 5 deletions
|
|
@ -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)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue