Return image result type of 'None' if no image is downloaded

Previously the resultType was being returned
PINRemoteImageResultTypeDownload even when the download failed. Now, we
check to see if the image has been set and if it not then we return
PINRemoteImageResultTypeNone.
This commit is contained in:
Adam Speakman
2015-10-11 10:21:36 -04:00
parent ea92ecb754
commit 82015fb881

View File

@@ -54,11 +54,17 @@
PINLog(@"calling completion for UUID: %@ key: %@", UUID, strongSelf.key);
dispatch_async(queue, ^
{
PINRemoteImageResultType result;
if (image || animatedImage) {
result = cached ? PINRemoteImageResultTypeCache : PINRemoteImageResultTypeDownload;
} else {
result = PINRemoteImageResultTypeNone;
}
callback.completionBlock([PINRemoteImageManagerResult imageResultWithImage:image
animatedImage:animatedImage
requestLength:CACurrentMediaTime() - callback.requestTime
error:error
resultType:cached?PINRemoteImageResultTypeCache:PINRemoteImageResultTypeDownload
resultType:result
UUID:UUID]);
});
}