Skip to content

Commit

Permalink
Update App.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
niemasd authored Jan 25, 2024
1 parent dc5b701 commit 7ea6b64
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions website/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,18 @@ export class App extends Component {
if (this.state.REFS && this.state.REF_NAMES && this.state.refGenomes.size > 0) {
clearInterval(preloadRefInterval);
const preloadRefOptions = [];
const preloadRefOptionsUniqueNames = new Set();
for (const REF_NAME_MAP of this.state.REF_NAMES) {
const REF_NAME_MAP_TYPE = [...REF_NAME_MAP[1]]
for (const REF_NAME of REF_NAME_MAP_TYPE) {
const virus = REF_NAME[0];
const commonName = REF_NAME[1];
preloadRefOptions.push(
<option value={this.state.REFS.get(virus)} key={commonName}>{commonName}</option>
)
if(!preloadRefOptionsUniqueNames.has(commonName)) {
preloadRefOptionsUniqueNames.add(commonName);
preloadRefOptions.push(
<option value={this.state.REFS.get(virus)} key={commonName}>{commonName}</option>
)
}
}
}

Expand Down Expand Up @@ -368,4 +372,4 @@ export class App extends Component {
}
}

export default App
export default App

1 comment on commit 7ea6b64

@niemasd
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attempt to prevent duplicate entries in web app preloaded reference genome dropdown

Please sign in to comment.