Skip to content

Commit a34b4f9

Browse files
committed
Update OfflineImage.js
1 parent 1ecafdf commit a34b4f9

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/OfflineImage.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,8 @@ class OfflineImage extends React.Component {
3838
const nextSource = this.props.source;
3939
const reloadImage = this.props.reloadImage;
4040
const source = prevProps.source;
41-
const getImageSize = this.props.getImageSize;
4241
if (nextSource.uri !== source.uri) {
4342
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-
}
5043
this.setState({ path: offlinePath });
5144
offlineImageStore.subscribe(nextSource, this.handler, reloadImage);
5245
}
@@ -66,19 +59,13 @@ class OfflineImage extends React.Component {
6659
* Case 2: Show Fallback image if given until image gets downloaded
6760
* Case 3: Never cache image if property 'reloadImage' === never
6861
*/
69-
const { source, reloadImage, getImageSize } = this.props;
62+
const { source, reloadImage } = this.props;
7063

7164
// TODO: check source type as 'ImageURISource'
7265
// Download only if property 'uri' exists
7366
if (source.uri) {
7467
// Get image offline path if already exist else it returns undefined
7568
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-
}
8269
this.setState({ path: offlinePath });
8370
// Subscribe so that we can re-render once image downloaded!
8471
offlineImageStore.subscribe(source, this.handler, reloadImage);

0 commit comments

Comments
 (0)