mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Do not switch queues if not necessary
Summary: Changelog: [Internal] Switching queue here is not necessary if we are already on the main queue. This is important for Fabric SSTs, otherwise images are missing. Reviewed By: shergin Differential Revision: D19907908 fbshipit-source-id: 52e82484afc8e2f591d0c5cc126952990d992e96
This commit is contained in:
committed by
Facebook Github Bot
parent
5aae380f2d
commit
cebc2c9d3e
@@ -7,6 +7,7 @@
|
||||
|
||||
#import "RCTImageResponseObserverProxy.h"
|
||||
|
||||
#import <React/RCTUtils.h>
|
||||
#import <react/imagemanager/ImageResponse.h>
|
||||
#import <react/imagemanager/ImageResponseObserver.h>
|
||||
#import <react/utils/ManagedObjectWrapper.h>
|
||||
@@ -24,7 +25,7 @@ void RCTImageResponseObserverProxy::didReceiveImage(ImageResponse const &imageRe
|
||||
UIImage *image = (UIImage *)unwrapManagedObject(imageResponse.getImage());
|
||||
id<RCTImageResponseDelegate> delegate = delegate_;
|
||||
auto this_ = this;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
RCTExecuteOnMainQueue(^{
|
||||
[delegate didReceiveImage:image fromObserver:this_];
|
||||
});
|
||||
}
|
||||
@@ -33,7 +34,7 @@ void RCTImageResponseObserverProxy::didReceiveProgress(float progress) const
|
||||
{
|
||||
auto this_ = this;
|
||||
id<RCTImageResponseDelegate> delegate = delegate_;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
RCTExecuteOnMainQueue(^{
|
||||
[delegate didReceiveProgress:progress fromObserver:this_];
|
||||
});
|
||||
}
|
||||
@@ -42,7 +43,7 @@ void RCTImageResponseObserverProxy::didReceiveFailure() const
|
||||
{
|
||||
auto this_ = this;
|
||||
id<RCTImageResponseDelegate> delegate = delegate_;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
RCTExecuteOnMainQueue(^{
|
||||
[delegate didReceiveFailureFromObserver:this_];
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user