diff --git a/damus/Components/ImageCarousel.swift b/damus/Components/ImageCarousel.swift index ffa7005f..ddbd69e9 100644 --- a/damus/Components/ImageCarousel.swift +++ b/damus/Components/ImageCarousel.swift @@ -231,10 +231,10 @@ struct ImageCarousel: View { KFAnimatedImage(url) .callbackQueue(.dispatch(.global(qos: .background))) .processingQueue(.dispatch(.global(qos: .background))) + .cancelOnDisappear(true) + .backgroundDecode() .cacheOriginalImage() - .loadDiskFileSynchronously() .scaleFactor(UIScreen.main.scale) - .fade(duration: 0.1) .configure { view in view.framePreloadCount = 3 } diff --git a/damus/Views/BannerImageView.swift b/damus/Views/BannerImageView.swift index a1371f69..7e5c4a9e 100644 --- a/damus/Views/BannerImageView.swift +++ b/damus/Views/BannerImageView.swift @@ -33,15 +33,15 @@ struct InnerBannerImageView: View { .processingQueue(.dispatch(.global(qos: .background))) .serialize(by: imageModel.serializer) .setProcessor(imageModel.processor) + .cacheOriginalImage() .configure { view in - view.framePreloadCount = 1 + view.framePreloadCount = 3 } .placeholder { _ in Color(uiColor: .secondarySystemBackground) } .scaleFactor(UIScreen.main.scale) .loadDiskFileSynchronously() - .fade(duration: 0.1) .onFailureImage(defaultImage) .id(imageModel.refreshID) } else { diff --git a/damus/Views/ProfilePicView.swift b/damus/Views/ProfilePicView.swift index 09742372..10b7f7f7 100644 --- a/damus/Views/ProfilePicView.swift +++ b/damus/Views/ProfilePicView.swift @@ -70,19 +70,20 @@ struct InnerProfilePicView: View { KFAnimatedImage(imageModel.url) .callbackQueue(.dispatch(.global(qos: .background))) .processingQueue(.dispatch(.global(qos: .background))) + .cancelOnDisappear(true) + .backgroundDecode() .serialize(by: imageModel.serializer) .setProcessor(imageModel.processor) .cacheOriginalImage() + .scaleFactor(UIScreen.main.scale) .configure { view in - view.framePreloadCount = 1 + view.framePreloadCount = 3 } .placeholder { _ in Placeholder } - .scaleFactor(UIScreen.main.scale) - .loadDiskFileSynchronously() - .fade(duration: 0.1) - .onFailure { _ in + .onFailure { error in + if error.isTaskCancelled { return } imageModel.downloadFailed() } .id(imageModel.refreshID)