mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Revert "Drop iOS 14 and macOS 11 support"
This reverts commit dcef7f47ff
.
This commit is contained in:
@@ -48,19 +48,23 @@ struct ThumbnailView: View {
|
||||
}
|
||||
|
||||
@ViewBuilder var asyncImageIfAvailable: some View {
|
||||
CachedAsyncImage(url: url, urlCache: BaseCacheModel.imageCache, transaction: Transaction(animation: .default)) { phase in
|
||||
switch phase {
|
||||
case let .success(image):
|
||||
image
|
||||
.resizable()
|
||||
case .failure:
|
||||
placeholder.onAppear {
|
||||
guard let url else { return }
|
||||
thumbnails.insertUnloadable(url)
|
||||
if #available(iOS 15, macOS 12, *) {
|
||||
CachedAsyncImage(url: url, urlCache: BaseCacheModel.imageCache) { phase in
|
||||
switch phase {
|
||||
case let .success(image):
|
||||
image
|
||||
.resizable()
|
||||
case .failure:
|
||||
placeholder.onAppear {
|
||||
guard let url else { return }
|
||||
thumbnails.insertUnloadable(url)
|
||||
}
|
||||
default:
|
||||
placeholder
|
||||
}
|
||||
default:
|
||||
placeholder
|
||||
}
|
||||
} else {
|
||||
webImage
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user