revert D2372548 to fix initial app state issue
Reviewed By: @hedgerwang Differential Revision: D2480492
This commit is contained in:
parent
65253e3915
commit
0fb3d8de83
|
@ -122,7 +122,11 @@ var AppStateIOS = {
|
||||||
_eventHandlers[type].delete(handler);
|
_eventHandlers[type].delete(handler);
|
||||||
},
|
},
|
||||||
|
|
||||||
currentState: (RCTAppState && RCTAppState.initialAppState : ?string),
|
// TODO: getCurrentAppState callback seems to be called at a really late stage
|
||||||
|
// after app launch. Trying to get currentState when mounting App component
|
||||||
|
// will likely to have the initial value here.
|
||||||
|
// Initialize to 'active' instead of null.
|
||||||
|
currentState: ('active' : ?string),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -101,13 +101,4 @@ RCT_EXPORT_METHOD(getCurrentAppState:(RCTResponseSenderBlock)callback
|
||||||
callback(@[@{@"app_state": _lastKnownState}]);
|
callback(@[@{@"app_state": _lastKnownState}]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - RCTBridgeModule
|
|
||||||
|
|
||||||
- (NSDictionary *)constantsToExport
|
|
||||||
{
|
|
||||||
return @{
|
|
||||||
@"initialAppState" : RCTCurrentAppBackgroundState()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue