From a03b670dfaaadc6c3dcab3f1bb7d8c92e5bdcd64 Mon Sep 17 00:00:00 2001 From: Neil Marcellini Date: Mon, 25 Jul 2022 15:53:32 -0700 Subject: [PATCH 1/4] Prevent rendering plaidData.error as empty string --- src/components/AddPlaidBankAccount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AddPlaidBankAccount.js b/src/components/AddPlaidBankAccount.js index 62598e658f0f..b6895d9efec0 100644 --- a/src/components/AddPlaidBankAccount.js +++ b/src/components/AddPlaidBankAccount.js @@ -148,7 +148,7 @@ class AddPlaidBankAccount extends React.Component { )} - {this.props.plaidData.error && ( + {(this.props.plaidData.error) && ( {this.props.plaidData.error} From 6d5dcf8460dc7290b3a890b5dd3aaf22c29ba280 Mon Sep 17 00:00:00 2001 From: Neil Marcellini Date: Tue, 26 Jul 2022 11:06:00 -0700 Subject: [PATCH 2/4] Prevent duplicate from old plaid link --- src/components/AddPlaidBankAccount.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/AddPlaidBankAccount.js b/src/components/AddPlaidBankAccount.js index b6895d9efec0..d834898e6450 100644 --- a/src/components/AddPlaidBankAccount.js +++ b/src/components/AddPlaidBankAccount.js @@ -217,6 +217,7 @@ export default compose( }, plaidLinkToken: { key: ONYXKEYS.PLAID_LINK_TOKEN, + initWithStoredValues: false, }, }), )(AddPlaidBankAccount); From f0c5de827fd2308a7013c8ab9b6a8c0528049aec Mon Sep 17 00:00:00 2001 From: Neil Marcellini Date: Tue, 26 Jul 2022 11:07:40 -0700 Subject: [PATCH 3/4] Add parentheses for conditional render --- src/components/AddPlaidBankAccount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AddPlaidBankAccount.js b/src/components/AddPlaidBankAccount.js index d834898e6450..959b9a87376c 100644 --- a/src/components/AddPlaidBankAccount.js +++ b/src/components/AddPlaidBankAccount.js @@ -153,7 +153,7 @@ class AddPlaidBankAccount extends React.Component { {this.props.plaidData.error} )} - {token && ( + {(token) && ( { From 6f79acba790ac5ba1057bb9d2458a6fb7328d7ba Mon Sep 17 00:00:00 2001 From: Neil Marcellini Date: Tue, 26 Jul 2022 11:51:04 -0700 Subject: [PATCH 4/4] Use Boolean constructor for conditional rendering --- src/components/AddPlaidBankAccount.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/AddPlaidBankAccount.js b/src/components/AddPlaidBankAccount.js index 959b9a87376c..c0f926430b0c 100644 --- a/src/components/AddPlaidBankAccount.js +++ b/src/components/AddPlaidBankAccount.js @@ -148,12 +148,12 @@ class AddPlaidBankAccount extends React.Component { )} - {(this.props.plaidData.error) && ( + {Boolean(this.props.plaidData.error) && ( {this.props.plaidData.error} )} - {(token) && ( + {Boolean(token) && ( {