@@ -38,15 +38,8 @@ class OfflineImage extends React.Component {
38
38
const nextSource = this . props . source ;
39
39
const reloadImage = this . props . reloadImage ;
40
40
const source = prevProps . source ;
41
- const getImageSize = this . props . getImageSize ;
42
41
if ( nextSource . uri !== source . uri ) {
43
42
const offlinePath = offlineImageStore . getImageOfflinePath ( nextSource . uri ) ;
44
- if ( offlinePath && getImageSize ) {
45
- ( async ( ) => {
46
- const { width, height } = Image . resolveAssetSource ( offlinePath ) ;
47
- getImageSize ( { width, height } ) ;
48
- } ) ( ) ;
49
- }
50
43
this . setState ( { path : offlinePath } ) ;
51
44
offlineImageStore . subscribe ( nextSource , this . handler , reloadImage ) ;
52
45
}
@@ -66,19 +59,13 @@ class OfflineImage extends React.Component {
66
59
* Case 2: Show Fallback image if given until image gets downloaded
67
60
* Case 3: Never cache image if property 'reloadImage' === never
68
61
*/
69
- const { source, reloadImage, getImageSize } = this . props ;
62
+ const { source, reloadImage } = this . props ;
70
63
71
64
// TODO: check source type as 'ImageURISource'
72
65
// Download only if property 'uri' exists
73
66
if ( source . uri ) {
74
67
// Get image offline path if already exist else it returns undefined
75
68
const offlinePath = offlineImageStore . getImageOfflinePath ( source . uri ) ;
76
- if ( offlinePath && getImageSize ) {
77
- ( async ( ) => {
78
- const { width, height } = Image . resolveAssetSource ( offlinePath ) ;
79
- getImageSize ( { width, height } ) ;
80
- } ) ( ) ;
81
- }
82
69
this . setState ( { path : offlinePath } ) ;
83
70
// Subscribe so that we can re-render once image downloaded!
84
71
offlineImageStore . subscribe ( source , this . handler , reloadImage ) ;
0 commit comments