Skip to content

Commit

Permalink
fix: bools
Browse files Browse the repository at this point in the history
  • Loading branch information
dojolew committed Nov 25, 2024
1 parent d819812 commit 346a452
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions ios/DojoReactNativePaySdkConfig.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (NSString *) applePayMerchantId {
- (BOOL) isProduction {
#ifdef RCT_NEW_ARCH_ENABLED
std::optional<bool> isProduction = config->isProduction();
return isProduction.has_value() && isProduction.value() == false;
return !isProduction.has_value() || isProduction.value();
#else
NSNumber *isProduction = config[@"isProduction"];
return isProduction != nil && isProduction.boolValue == false;
Expand All @@ -55,12 +55,7 @@ - (BOOL) isProduction {
- (BOOL) useDarkTheme {
#ifdef RCT_NEW_ARCH_ENABLED
std::optional<bool> darkTheme = config->darkTheme();

if (darkTheme.has_value() && darkTheme.value() == true) {
return true;
}

return false;
return darkTheme.has_value() && darkTheme.value() == true;
#else
NSNumber *darkTheme = config[@"darkTheme"];
return darkTheme != nil && darkTheme.boolValue == true;
Expand All @@ -70,12 +65,7 @@ - (BOOL) useDarkTheme {
- (BOOL) showBranding {
#ifdef RCT_NEW_ARCH_ENABLED
std::optional<bool> darkTheme = config->darkTheme();

if (darkTheme.has_value() && darkTheme.value()) {
return true;
}

return false;
return !darkTheme.has_value() || darkTheme.value() == true;
#else
NSNumber *showBranding = config[@"showBranding"];
return showBranding != nil && showBranding.boolValue == true;
Expand Down

0 comments on commit 346a452

Please sign in to comment.