Use async on dispatch queue to prevent stuttering

This commit is contained in:
Yoshi Sugawara 2025-04-01 05:41:43 -10:00
parent 207afd9a32
commit ad91ea5b1b

View file

@ -19,15 +19,19 @@ class AppStoreIconFetcher {
return
}
iconFetchDispatchQueue.sync {
iconFetchDispatchQueue.async {
do {
let ans = try JITEnableContext.shared.getAppIcon(withBundleId: bundleID)
iconCache[bundleID] = ans
completion(ans)
DispatchQueue.main.async {
iconCache[bundleID] = ans
completion(ans)
}
} catch {
print("Failed to get icon: \(error)")
completion(nil)
DispatchQueue.main.async {
completion(nil)
}
}
}
}
}
}