Skip to content

Commit

Permalink
Merge pull request #1794 from nextstrain/james/fix-filter-badge
Browse files Browse the repository at this point in the history
Fix filter badge display for single trees
  • Loading branch information
jameshadfield authored Jun 25, 2024
2 parents 5afe581 + 064e330 commit 23c4a24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

* Small bugfix to the filter badge improvements introduced in v2.55.0 where we incorrectly showed the 2-tree display when viewing a single tree. ([#1794](https://github.com/nextstrain/auspice/pull/1794))

## version 2.55.0 - 2024/06/17


Expand Down
2 changes: 1 addition & 1 deletion src/components/info/filtersSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class FiltersSummary extends React.Component {
If we have two trees shown we show both values.
*/
const tree1count = this.props.totalStateCounts[filterName]?.get(item.value) ?? 0;
if (this.props.totalStateCountsSecondTree) {
if (this.props.totalStateCountsSecondTree && Reflect.ownKeys(this.props.totalStateCountsSecondTree).length) {
const tree2count = this.props.totalStateCountsSecondTree[filterName]?.get(item.value) ?? 0;
label+=` (L: ${tree1count}, R: ${tree2count})`;
} else {
Expand Down

0 comments on commit 23c4a24

Please sign in to comment.