From ad91ea5b1b6200b61fe3264eae5f3376357c0273 Mon Sep 17 00:00:00 2001 From: Yoshi Sugawara Date: Tue, 1 Apr 2025 05:41:43 -1000 Subject: [PATCH] Use async on dispatch queue to prevent stuttering --- StikJIT/Utilities/AppStoreIconFetcher.swift | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/StikJIT/Utilities/AppStoreIconFetcher.swift b/StikJIT/Utilities/AppStoreIconFetcher.swift index c093386a..6542d514 100644 --- a/StikJIT/Utilities/AppStoreIconFetcher.swift +++ b/StikJIT/Utilities/AppStoreIconFetcher.swift @@ -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) + } } } } -} +}