From d105ae7e519d0c26578aa0c6e7b6e1768008cbf3 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Mon, 22 Jun 2015 16:43:06 -0700 Subject: [PATCH] [AdsManager] Fix Navigation focus events for logging --- .../Navigator/Navigation/NavigationContext.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js b/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js index d146f14d0..35ed24e3a 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js +++ b/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js @@ -44,7 +44,8 @@ class NavigationContext { constructor() { this._eventEmitter = new NavigationEventEmitter(this); this._currentRoute = null; - this.addListener('didfocus', this._onDidFocus, this); + this.addListener('willfocus', this._onFocus, this); + this.addListener('didfocus', this._onFocus, this); } // TODO: @flow does not like this getter. Will add @flow check back once @@ -83,7 +84,7 @@ class NavigationContext { } } - _onDidFocus(event: NavigationEvent): void { + _onFocus(event: NavigationEvent): void { invariant( event.data && event.data.hasOwnProperty('route'), 'didfocus event should provide route'