1
1
import React , { PureComponent } from 'react' ;
2
2
import { View } from 'react-native' ;
3
3
import PropTypes from 'prop-types' ;
4
- import lodashGet from 'lodash/get' ;
5
4
import Log from '../libs/Log' ;
6
5
import styles from '../styles/styles' ;
7
6
import FullscreenLoadingIndicator from './FullscreenLoadingIndicator' ;
@@ -45,7 +44,7 @@ class ImageWithSizeCalculation extends PureComponent {
45
44
this . imageLoadingStart = this . imageLoadingStart . bind ( this ) ;
46
45
this . imageLoadingEnd = this . imageLoadingEnd . bind ( this ) ;
47
46
this . onError = this . onError . bind ( this ) ;
48
- this . imageLoadedSuccessfuly = this . imageLoadedSuccessfuly . bind ( this ) ;
47
+ this . imageLoadedSuccessfully = this . imageLoadedSuccessfully . bind ( this ) ;
49
48
}
50
49
51
50
onError ( ) {
@@ -60,13 +59,11 @@ class ImageWithSizeCalculation extends PureComponent {
60
59
this . setState ( { isLoading : false } ) ;
61
60
}
62
61
63
- imageLoadedSuccessfuly ( event ) {
64
- if ( ! lodashGet ( event , 'nativeEvent.width' , false ) || ! lodashGet ( event , 'nativeEvent.height' , false ) ) {
65
- // Image didn't load properly
66
- return ;
67
- }
68
-
69
- this . props . onMeasure ( { width : event . nativeEvent . width , height : event . nativeEvent . height } ) ;
62
+ imageLoadedSuccessfully ( event ) {
63
+ this . props . onMeasure ( {
64
+ width : event . nativeEvent . width ,
65
+ height : event . nativeEvent . height ,
66
+ } ) ;
70
67
}
71
68
72
69
render ( ) {
@@ -89,7 +86,7 @@ class ImageWithSizeCalculation extends PureComponent {
89
86
onLoadStart = { this . imageLoadingStart }
90
87
onLoadEnd = { this . imageLoadingEnd }
91
88
onError = { this . onError }
92
- onLoad = { this . imageLoadedSuccessfuly }
89
+ onLoad = { this . imageLoadedSuccessfully }
93
90
/>
94
91
{ this . state . isLoading && (
95
92
< FullscreenLoadingIndicator
0 commit comments