Skip to content

Commit

Permalink
fix(ios): fix issue when some value from advancedOptions is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
JonatanSalas committed Oct 1, 2020
1 parent 65b666d commit 56d3194
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ios/ReactNativeMercadopagoPx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,18 @@ class ReactNativeMercadopagoPx: NSObject {
if productId != nil {
config.setProductId(id: productId!);
}

let bankDealsEnabled = advancedOptions?[JsOptions.BANK_DEALS_ENABLED] as! Bool?;

if bankDealsEnabled != nil {
config.bankDealsEnabled = bankDealsEnabled!;
}

let amountRowEnabled = advancedOptions?[JsOptions.AMOUNT_ROW_ENABLED] as! Bool?;

config.bankDealsEnabled = bankDealsEnabled!;
config.amountRowEnabled = amountRowEnabled!;
if amountRowEnabled != nil {
config.amountRowEnabled = amountRowEnabled!;
}

builder.setAdvancedConfiguration(config: config);
}
Expand Down

0 comments on commit 56d3194

Please sign in to comment.