Skip to content

Commit

Permalink
bug fix -- genome list reversed every other invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Feb 7, 2024
1 parent d21c50f commit deda89c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/genomeWidgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function createGenomeWidgets({$igvMain, urlModalId, genomeFileLoad}) {
*/
async function initializeGenomeWidgets(genomes) {
try {
predefinedGenomes = await getAppLaunchGenomes(genomes)// Default genome list
predefinedGenomes = (await getAppLaunchGenomes(genomes)).reverse() // Default genome list
predefinedGenomeIds = new Set(predefinedGenomes.map(g => g.id))
updateGenomeList()

Expand Down Expand Up @@ -114,7 +114,7 @@ async function getAppLaunchGenomes(genomes) {

function getCustomGenomes() {
const customGenomeString = localStorage.getItem("customGenomes")
return customGenomeString ? JSON.parse(customGenomeString) : []
return customGenomeString ? JSON.parse(customGenomeString).reverse() : []
}


Expand Down Expand Up @@ -151,15 +151,15 @@ function updateGenomeList() {
// TODO -- why do we need to add everthing in reverse?

if (predefinedGenomes && predefinedGenomes.length > 0) {
for (let genomeJson of predefinedGenomes.reverse()) {
for (let genomeJson of predefinedGenomes) {
addEntryFor(genomeJson)
}
}

const customGenomes = getCustomGenomes()
if (customGenomes && customGenomes.length > 0) {
$('<div class="dropdown-divider"></div>').insertAfter($divider)
for (let genomeJson of customGenomes.reverse()) {
for (let genomeJson of customGenomes) {
addEntryFor(genomeJson)
}

Expand Down

0 comments on commit deda89c

Please sign in to comment.