moved `reactBridgeDidFinishTransaction` calls

Summary: Previously `_bridgeTransactionListeners` were informed about `reactBridgeDidFinishTransaction` inside of one of the UI blocks.
That seems pretty arbitrary, doesn't really mean a "transaction" is really over (assuming transaction means all UI updates) and even when that block does nothing we still need to call these listeners, since there could be other UI blocks generated somewhere else!
So I've moved this call to a place that seemed better (=after all UI blocks are done), since all listeners are interested in knowing when layout has happened.

public

Reviewed By: nicklockwood

Differential Revision: D2571122

fb-gh-sync-id: 62be03ebc4353d6f6318c9765079b87b07483be2
This commit is contained in:
Martin Kralik 2015-10-27 05:07:40 -07:00 committed by facebook-github-bot-5
parent 500ffa9b76
commit af70d05838
1 changed files with 8 additions and 7 deletions

View File

@ -575,13 +575,6 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls);
} withCompletionBlock:nil];
}
}
/**
* TODO(tadeu): Remove it once and for all
*/
for (id<RCTComponent> node in _bridgeTransactionListeners) {
[node reactBridgeDidFinishTransaction];
}
};
}
@ -908,6 +901,14 @@ RCT_EXPORT_METHOD(findSubviewIn:(nonnull NSNumber *)reactTag atPoint:(CGPoint)po
for (dispatch_block_t block in previousPendingUIBlocks) {
block();
}
/**
* TODO(tadeu): Remove it once and for all
*/
if (previousPendingUIBlocks.count) {
for (id<RCTComponent> node in _bridgeTransactionListeners) {
[node reactBridgeDidFinishTransaction];
}
}
}
@catch (NSException *exception) {
RCTLogError(@"Exception thrown while executing UI block: %@", exception);