Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions StikJIT/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down