Skip to content

Commit

Permalink
Reverted commit D3604593
Browse files Browse the repository at this point in the history
Differential Revision: D3604593

fbshipit-source-id: fe792739dbe4af294ef0071b4db4ab181adcb874
  • Loading branch information
bestander authored and Facebook Github Bot 1 committed Jul 23, 2016
1 parent eb59ae8 commit 64b0929
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Libraries/Image/Image.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
var View = require('View');

var emptyFunction = require('emptyFunction');
var flattenStyle = require('flattenStyle');
var merge = require('merge');
var requireNativeComponent = require('requireNativeComponent');
Expand Down Expand Up @@ -141,12 +140,6 @@ var Image = React.createClass({
success: (width: number, height: number) => void,
failure: (error: any) => void,
) {
if (!ImageLoader) {
failure ?
failure() :
console.warn('ImageLoader native module is missing, image size cannot be fetched.');
return;
}
return ImageLoader.getSize(url)
.then(function(sizes) {
success(sizes.width, sizes.height);
Expand All @@ -161,10 +154,6 @@ var Image = React.createClass({
* cache
*/
prefetch(url: string, callback: ?Function) {
if (!ImageLoader) {
console.warn('ImageLoader native module is missing, image will not preload.');
return new Promise(emptyFunction);
}
const requestId = generateRequestId();
callback && callback(requestId);
return ImageLoader.prefetchImage(url, requestId);
Expand All @@ -174,7 +163,7 @@ var Image = React.createClass({
* Abort prefetch request
*/
abortPrefetch(requestId: number) {
ImageLoader && ImageLoader.abortRequest(requestId);
ImageLoader.abortRequest(requestId);
},
},

Expand Down

0 comments on commit 64b0929

Please sign in to comment.