Fabric: Fixed onLoadEnd event in RCTImageComponentView

Summary:
`onLoadEnd` event should be called when load either succeeds or fails.
Before the fix, we didn't call it on error case.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18566996

fbshipit-source-id: 92727e91be167eb1e8eec4a40e90097972097c05
This commit is contained in:
Valentin Shergin
2019-11-18 18:22:35 -08:00
committed by Facebook Github Bot
parent 719d52fb6b
commit ccc05cd054
@@ -139,6 +139,7 @@
}
std::static_pointer_cast<ImageEventEmitter const>(_eventEmitter)->onLoad();
std::static_pointer_cast<ImageEventEmitter const>(_eventEmitter)->onLoadEnd();
const auto &imageProps = *std::static_pointer_cast<ImageProps const>(_props);
@@ -160,8 +161,6 @@
// Apply trilinear filtering to smooth out mis-sized images.
self->_imageView.layer.minificationFilter = kCAFilterTrilinear;
self->_imageView.layer.magnificationFilter = kCAFilterTrilinear;
std::static_pointer_cast<ImageEventEmitter const>(self->_eventEmitter)->onLoadEnd();
}
- (void)didReceiveProgress:(float)progress fromObserver:(void const *)observer
@@ -182,6 +181,7 @@
}
std::static_pointer_cast<ImageEventEmitter const>(_eventEmitter)->onError();
std::static_pointer_cast<ImageEventEmitter const>(_eventEmitter)->onLoadEnd();
}
@end