mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Upgrade Kingfisher to fix a bug that prevented GIFs from being tapped. (#3326)
* Upgrade Kingfisher to fix a bug the prevented GIFs from being tapped. https://github.com/onevcat/Kingfisher/issues/2295 * Fix tests.
This commit is contained in:
@@ -38,8 +38,8 @@ struct MediaProvider: MediaProviderProtocol {
|
||||
}
|
||||
|
||||
let cacheKey = cacheKeyForURL(source.url, size: size)
|
||||
|
||||
if case let .success(cacheResult) = await imageCache.retrieveImage(forKey: cacheKey),
|
||||
|
||||
if let cacheResult = try? await imageCache.retrieveImage(forKey: cacheKey, options: nil),
|
||||
let image = cacheResult.image {
|
||||
return .success(image)
|
||||
}
|
||||
@@ -57,7 +57,7 @@ struct MediaProvider: MediaProviderProtocol {
|
||||
return .failure(.invalidImageData)
|
||||
}
|
||||
|
||||
imageCache.store(image, forKey: cacheKey)
|
||||
try await imageCache.store(image, forKey: cacheKey)
|
||||
|
||||
return .success(image)
|
||||
} catch {
|
||||
@@ -149,13 +149,3 @@ struct MediaProvider: MediaProviderProtocol {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension ImageCache {
|
||||
func retrieveImage(forKey key: String) async -> Result<ImageCacheResult, KingfisherError> {
|
||||
await withCheckedContinuation { continuation in
|
||||
retrieveImage(forKey: key) { result in
|
||||
continuation.resume(returning: result)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user