From be612998bde2886c3b542219cc4ff1c25bf80151 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 21 Jun 2018 12:14:16 +0100 Subject: [PATCH] invert boolean operation for readability and add comment Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/dialogs/AddressPickerDialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index 2dabe317dd..abc52f7b1d 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -523,8 +523,9 @@ module.exports = React.createClass({ selectedAddresses[addressType].add(address); }); + // Filter out any addresses in the above already selected addresses (matching both type and address) const filteredSuggestedList = this.state.suggestedList.filter(({address, addressType}) => { - return !selectedAddresses[addressType] || !selectedAddresses[addressType].has(address); + return !(selectedAddresses[addressType] && selectedAddresses[addressType].has(address)); }); const query = [];