[bugfix] cannot add options to FilterBox (#6231)

* [bugfix] cannot add options to FilterBox

* addressing comments
This commit is contained in:
Maxime Beauchemin 2018-10-30 21:59:57 -07:00 committed by GitHub
parent 2ad8e2ee2b
commit af38d254f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -178,8 +178,7 @@ class FilterBox extends React.Component {
// Add created options to filtersChoices, even though it doesn't exist,
// or these options will exist in query sql but invisible to end user.
Object.keys(selectedValues)
.filter(key => !selectedValues.hasOwnProperty(key)
|| !(key in filtersChoices))
.filter(key => selectedValues.hasOwnProperty(key) && (key in filtersChoices))
.forEach((key) => {
const choices = filtersChoices[key] || [];
const choiceIds = new Set(choices.map(f => f.id));