Skip to content

Commit

Permalink
iOS fixed up inconsistent boolean convertion logic in RCTPlatform
Browse files Browse the repository at this point in the history
Summary: For some reason the conversion from a BOOL object to `bool` (C++ style) may lead to incorrect boolean value. This fixes the value provided to the builder to be of `bool` type instead.

Reviewed By: JoshuaGross

Differential Revision: D16657766

fbshipit-source-id: b66922aceadd20d16226a07f73b24ee0a3b825dc
  • Loading branch information
fkgozali authored and facebook-github-bot committed Aug 6, 2019
1 parent 751d0e7 commit 28e18e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions React/CoreModules/RCTPlatform.mm
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ - (dispatch_queue_t)methodQueue
UIDevice *device = [UIDevice currentDevice];
auto versions = RCTGetReactNativeVersion();
return typedConstants<JS::NativePlatformConstantsIOS::Constants>({
.forceTouchAvailable = @(RCTForceTouchAvailable()),
.forceTouchAvailable = RCTForceTouchAvailable() ? true : false,
.osVersion = [device systemVersion],
.systemName = [device systemName],
.interfaceIdiom = interfaceIdiom([device userInterfaceIdiom]),
.isTesting = @(RCTRunningInTestEnvironment()),
.isTesting = RCTRunningInTestEnvironment() ? true : false,
.reactNativeVersion = JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder({
.minor = [versions[@"minor"] doubleValue],
.major = [versions[@"major"] doubleValue],
Expand Down

0 comments on commit 28e18e4

Please sign in to comment.