Skip to content

Commit 81e48be

Browse files
authored
Merge pull request #60 from yoshisuga/yoshisuga/app-icon-fetch-fix
App List: Use async on dispatch queue to prevent stuttering
2 parents 207afd9 + ad91ea5 commit 81e48be

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

StikJIT/Utilities/AppStoreIconFetcher.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@ class AppStoreIconFetcher {
1919
return
2020
}
2121

22-
iconFetchDispatchQueue.sync {
22+
iconFetchDispatchQueue.async {
2323
do {
2424
let ans = try JITEnableContext.shared.getAppIcon(withBundleId: bundleID)
25-
iconCache[bundleID] = ans
26-
completion(ans)
25+
DispatchQueue.main.async {
26+
iconCache[bundleID] = ans
27+
completion(ans)
28+
}
2729
} catch {
2830
print("Failed to get icon: \(error)")
29-
completion(nil)
31+
DispatchQueue.main.async {
32+
completion(nil)
33+
}
3034
}
3135
}
3236
}
33-
}
37+
}

0 commit comments

Comments
 (0)