@@ -49,7 +49,7 @@ - (instancetype)initWithControllerFactory:(RNNControllerFactory*)controllerFacto
4949
5050#pragma mark - public
5151
52- - (void )setRoot : (NSDictionary *)layout commandId : (NSString *)commandId completion : (RNNTransitionCompletionBlock )completion {
52+ - (void )setRoot : (NSDictionary *)layout commandId : (NSString *)commandId completion : (RNNTransitionWithComponentIdCompletionBlock )completion {
5353 [self assertReady ];
5454 RNNAssertMainQueue ();
5555
@@ -77,8 +77,8 @@ - (void)setRoot:(NSDictionary*)layout commandId:(NSString*)commandId completion:
7777 [vc setReactViewReadyCallback: ^{
7878 [self ->_mainWindow.rootViewController destroy ];
7979 self->_mainWindow .rootViewController = weakVC;
80- [self ->_eventEmitter sendOnNavigationCommandCompletion: setRoot commandId: commandId params: @{ @" layout " : layout} ];
81- completion ();
80+ [self ->_eventEmitter sendOnNavigationCommandCompletion: setRoot commandId: commandId];
81+ completion (weakVC. layoutInfo . componentId );
8282 }];
8383
8484 [vc render ];
@@ -112,7 +112,7 @@ - (void)setDefaultOptions:(NSDictionary*)optionsDict completion:(RNNTransitionCo
112112 completion ();
113113}
114114
115- - (void )push : (NSString *)componentId commandId : (NSString *)commandId layout : (NSDictionary *)layout completion : (RNNTransitionCompletionBlock )completion rejection : (RCTPromiseRejectBlock)rejection {
115+ - (void )push : (NSString *)componentId commandId : (NSString *)commandId layout : (NSDictionary *)layout completion : (RNNTransitionWithComponentIdCompletionBlock )completion rejection : (RCTPromiseRejectBlock)rejection {
116116 [self assertReady ];
117117 RNNAssertMainQueue ();
118118
@@ -131,8 +131,8 @@ - (void)push:(NSString*)componentId commandId:(NSString*)commandId layout:(NSDic
131131 if ([newVc.resolveOptionsWithDefault.preview.commit getWithDefaultValue: NO ]) {
132132 [CATransaction begin ];
133133 [CATransaction setCompletionBlock: ^{
134- [self ->_eventEmitter sendOnNavigationCommandCompletion: push commandId: commandId params: @{ @" componentId " : componentId} ];
135- completion ();
134+ [self ->_eventEmitter sendOnNavigationCommandCompletion: push commandId: commandId ];
135+ completion (newVc. layoutInfo . componentId );
136136 }];
137137 [rvc.navigationController pushViewController: newVc animated: YES ];
138138 [CATransaction commit ];
@@ -162,8 +162,8 @@ - (void)push:(NSString*)componentId commandId:(NSString*)commandId layout:(NSDic
162162 __weak UIViewController* weakNewVC = newVc;
163163 [newVc setReactViewReadyCallback: ^{
164164 [fromVC.stack push: weakNewVC onTop: fromVC animated: [weakNewVC.resolveOptionsWithDefault.animations.push.enable getWithDefaultValue: YES ] completion: ^{
165- [self ->_eventEmitter sendOnNavigationCommandCompletion: push commandId: commandId params: @{ @" componentId " : componentId} ];
166- completion ();
165+ [self ->_eventEmitter sendOnNavigationCommandCompletion: push commandId: commandId];
166+ completion (weakNewVC. layoutInfo . componentId );
167167 } rejection: rejection];
168168 }];
169169
@@ -189,7 +189,7 @@ - (void)setStackRoot:(NSString*)componentId commandId:(NSString*)commandId child
189189 newVC.waitForRender = ([options.animations.setStackRoot.waitForRender getWithDefaultValue: NO ]);
190190 [newVC setReactViewReadyCallback: ^{
191191 [fromVC.stack setStackChildren: childViewControllers fromViewController: fromVC animated: [options.animations.setStackRoot.enable getWithDefaultValue: YES ] completion: ^{
192- [weakEventEmitter sendOnNavigationCommandCompletion: setStackRoot commandId: commandId params: @{ @" componentId " : componentId} ];
192+ [weakEventEmitter sendOnNavigationCommandCompletion: setStackRoot commandId: commandId];
193193 completion ();
194194 } rejection: rejection];
195195 }];
@@ -207,7 +207,7 @@ - (void)pop:(NSString*)componentId commandId:(NSString*)commandId mergeOptions:(
207207 [vc overrideOptions: options];
208208
209209 [vc.stack pop: vc animated: [vc.resolveOptionsWithDefault.animations.pop.enable getWithDefaultValue: YES ] completion: ^{
210- [self ->_eventEmitter sendOnNavigationCommandCompletion: pop commandId: commandId params: @{ @" componentId " : componentId} ];
210+ [self ->_eventEmitter sendOnNavigationCommandCompletion: pop commandId: commandId];
211211 completion ();
212212 } rejection: rejection];
213213 } else {
@@ -224,7 +224,7 @@ - (void)popTo:(NSString*)componentId commandId:(NSString*)commandId mergeOptions
224224 [vc overrideOptions: options];
225225
226226 [vc.stack popTo: vc animated: [vc.resolveOptionsWithDefault.animations.pop.enable getWithDefaultValue: YES ] completion: ^(NSArray *poppedViewControllers) {
227- [self ->_eventEmitter sendOnNavigationCommandCompletion: popTo commandId: commandId params: @{ @" componentId " : componentId} ];
227+ [self ->_eventEmitter sendOnNavigationCommandCompletion: popTo commandId: commandId];
228228 completion ();
229229 } rejection: rejection];
230230}
@@ -239,7 +239,7 @@ - (void)popToRoot:(NSString*)componentId commandId:(NSString*)commandId mergeOpt
239239
240240 [CATransaction begin ];
241241 [CATransaction setCompletionBlock: ^{
242- [self ->_eventEmitter sendOnNavigationCommandCompletion: popToRoot commandId: commandId params: @{ @" componentId " : componentId} ];
242+ [self ->_eventEmitter sendOnNavigationCommandCompletion: popToRoot commandId: commandId];
243243 completion ();
244244 }];
245245
@@ -261,7 +261,7 @@ - (void)showModal:(NSDictionary*)layout commandId:(NSString *)commandId completi
261261 newVc.waitForRender = [newVc.resolveOptionsWithDefault.animations.showModal.waitForRender getWithDefaultValue: NO ];
262262 [newVc setReactViewReadyCallback: ^{
263263 [self ->_modalManager showModal: weakNewVC animated: [weakNewVC.resolveOptionsWithDefault.animations.showModal.enable getWithDefaultValue: YES ] completion: ^(NSString *componentId) {
264- [self ->_eventEmitter sendOnNavigationCommandCompletion: showModal commandId: commandId params: @{ @" layout " : layout} ];
264+ [self ->_eventEmitter sendOnNavigationCommandCompletion: showModal commandId: commandId];
265265 completion (weakNewVC.layoutInfo .componentId );
266266 }];
267267 }];
@@ -284,7 +284,7 @@ - (void)dismissModal:(NSString*)componentId commandId:(NSString*)commandId merge
284284
285285 [CATransaction begin ];
286286 [CATransaction setCompletionBlock: ^{
287- [self ->_eventEmitter sendOnNavigationCommandCompletion: dismissModal commandId: commandId params: @{ @" componentId " : componentId} ];
287+ [self ->_eventEmitter sendOnNavigationCommandCompletion: dismissModal commandId: commandId];
288288 }];
289289
290290 [_modalManager dismissModal: modalToDismiss completion: ^{
@@ -300,7 +300,7 @@ - (void)dismissAllModals:(NSDictionary *)mergeOptions commandId:(NSString*)comma
300300
301301 [CATransaction begin ];
302302 [CATransaction setCompletionBlock: ^{
303- [self ->_eventEmitter sendOnNavigationCommandCompletion: dismissAllModals commandId: commandId params: @{} ];
303+ [self ->_eventEmitter sendOnNavigationCommandCompletion: dismissAllModals commandId: commandId];
304304 completion ();
305305 }];
306306 RNNNavigationOptions* options = [[RNNNavigationOptions alloc ] initWithDict: mergeOptions];
@@ -309,7 +309,7 @@ - (void)dismissAllModals:(NSDictionary *)mergeOptions commandId:(NSString*)comma
309309 [CATransaction commit ];
310310}
311311
312- - (void )showOverlay : (NSDictionary *)layout commandId : (NSString *)commandId completion : (RNNTransitionCompletionBlock )completion {
312+ - (void )showOverlay : (NSDictionary *)layout commandId : (NSString *)commandId completion : (RNNTransitionWithComponentIdCompletionBlock )completion {
313313 [self assertReady ];
314314 RNNAssertMainQueue ();
315315
@@ -323,8 +323,8 @@ - (void)showOverlay:(NSDictionary *)layout commandId:(NSString*)commandId comple
323323 [self ->_overlayManager showOverlayWindow: overlayWindow];
324324 }
325325
326- [self ->_eventEmitter sendOnNavigationCommandCompletion: showOverlay commandId: commandId params: @{ @" layout " : layout} ];
327- completion ();
326+ [self ->_eventEmitter sendOnNavigationCommandCompletion: showOverlay commandId: commandId];
327+ completion (weakOverlayVC. layoutInfo . componentId );
328328
329329 }];
330330
@@ -338,7 +338,7 @@ - (void)dismissOverlay:(NSString*)componentId commandId:(NSString*)commandId com
338338 UIViewController* viewController = [RNNLayoutManager findComponentForId: componentId];
339339 if (viewController) {
340340 [_overlayManager dismissOverlay: viewController];
341- [_eventEmitter sendOnNavigationCommandCompletion: dismissOverlay commandId: commandId params: @{ @" componentId " : componentId} ];
341+ [_eventEmitter sendOnNavigationCommandCompletion: dismissOverlay commandId: commandId];
342342 completion ();
343343 } else {
344344 [RNNErrorHandler reject: reject withErrorCode: 1010 errorDescription: @" ComponentId not found" ];
0 commit comments