Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filter badge display for single trees #1794

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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