Skip to content

Commit

Permalink
Merge pull request #42 from TeletronicsDotAe/master
Browse files Browse the repository at this point in the history
Sometimes preview image will render instead of actual image
  • Loading branch information
kfiroo authored Jun 5, 2017
2 parents 6d6a96f + fff0c9d commit c3c6dbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CachedImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const CachedImage = React.createClass({
} : this.props.source;
return this.props.renderImage({
...props,
key: props.key || source.uri,
style,
source
});
Expand All @@ -169,7 +170,7 @@ const CachedImage = React.createClass({

// if the imageStyle has borderRadius it will break the loading image view on android
// so we only show the ActivityIndicator
if (Platform.OS === 'android' && flattenStyle(imageStyle).borderRadius) {
if (!source || (Platform.OS === 'android' && flattenStyle(imageStyle).borderRadius)) {
return (
<ActivityIndicator
{...activityIndicatorProps}
Expand All @@ -180,6 +181,7 @@ const CachedImage = React.createClass({
return this.props.renderImage({
...imageProps,
style: imageStyle,
key: source.uri,
source,
children: (
<ActivityIndicator
Expand Down

0 comments on commit c3c6dbb

Please sign in to comment.