mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Need to set defaultImage, not image if we're a network image node. (#3041)
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#import <AsyncDisplayKit/ASImageNode+AnimatedImagePrivate.h>
|
||||
#import <AsyncDisplayKit/ASImageProtocols.h>
|
||||
#import <AsyncDisplayKit/ASInternalHelpers.h>
|
||||
#import <AsyncDisplayKit/ASNetworkImageNode.h>
|
||||
#import <AsyncDisplayKit/ASWeakProxy.h>
|
||||
|
||||
NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes;
|
||||
@@ -91,6 +92,17 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes;
|
||||
}
|
||||
|
||||
if (setCoverImage) {
|
||||
[self setCoverImage:coverImage];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setCoverImage:(UIImage *)coverImage
|
||||
{
|
||||
//If we're a network image node, we want to set the default image so
|
||||
//that it will correctly be restored if it exits the range.
|
||||
if ([self isKindOfClass:[ASNetworkImageNode class]]) {
|
||||
[(ASNetworkImageNode *)self setDefaultImage:coverImage];
|
||||
} else {
|
||||
self.image = coverImage;
|
||||
}
|
||||
}
|
||||
@@ -172,7 +184,7 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes;
|
||||
[super didEnterVisibleState];
|
||||
|
||||
if (self.animatedImage.coverImageReady) {
|
||||
self.image = self.animatedImage.coverImage;
|
||||
[self setCoverImage:self.animatedImage.coverImage];
|
||||
}
|
||||
[self startAnimating];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user