diff --git a/CHANGELOG.md b/CHANGELOG.md index be0ecf2e8..c720c0b0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +* We no longer show the "second tree" sidebar dropdown when there are no available options. The possible options are defined by [the charon/getAvailable API](https://docs.nextstrain.org/projects/auspice/en/stable/server/api.html) response and as such vary depending on the server in use. ([#1795](https://github.com/nextstrain/auspice/pull/1795)) + + ## version 2.55.1 - 2024/06/25 diff --git a/src/components/controls/choose-second-tree.js b/src/components/controls/choose-second-tree.js index 73267b83f..b7a8766ba 100644 --- a/src/components/controls/choose-second-tree.js +++ b/src/components/controls/choose-second-tree.js @@ -33,6 +33,9 @@ class ChooseSecondTree extends React.Component { .filter((opt) => !!opt) // .secondTreeOptions is not required )] + // Don't display the sidebar UI if we're just going to display an empty dropdown! + if (!options.length) return null; + if (this.props.showTreeToo) options.unshift("REMOVE"); const selectOptions = options.map((opt) => ({value: opt, label: opt}));