Skip to content

Commit 80fe08b

Browse files
Fixed 2 small startup bugs
1 parent 56a9c4c commit 80fe08b

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/CanvasController.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -633,15 +633,17 @@ export default class CanvasController {
633633
traitColors: (customColors == null ? {} : JSON.parse(customColors)),
634634
};
635635

636-
// We use trait values as keys in inner arrays for persisting to Local-storage, so we need to convert those back to list indexes on reload
637-
Object.entries(settings.traitColors).forEach(([traitName, colorByValue]) => Object.entries(colorByValue)
638-
.forEach(([traitValue, traitValueColor]) => {
639-
var trait = this.dataSet.traits.get(traitName), traitValueIndex = trait == null ? -1 : trait.values.indexOf(traitValue), traitColorMap = settings.traitColors[traitName];
640-
if (traitValueIndex != -1)
641-
traitColorMap[traitValueIndex] = traitValueColor;
642-
delete traitColorMap[traitValue];
643-
}
644-
));
636+
if (displayTraitSelect != null) {
637+
// We use trait values as keys in inner arrays for persisting to Local-storage, so we need to convert those back to list indexes on reload
638+
Object.entries(settings.traitColors).forEach(([traitName, colorByValue]) => Object.entries(colorByValue)
639+
.forEach(([traitValue, traitValueColor]) => {
640+
var trait = this.dataSet.traits.get(traitName), traitValueIndex = trait == null ? -1 : trait.values.indexOf(traitValue), traitColorMap = settings.traitColors[traitName];
641+
if (traitValueIndex != -1)
642+
traitColorMap[traitValueIndex] = traitValueColor;
643+
delete traitColorMap[traitValue];
644+
}
645+
));
646+
}
645647

646648
switch (sortId) {
647649
case "importing":

src/GenotypeImporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default class GenotypeImporter {
9191
const lines = fileContents.split(/\r?\n/);
9292
this.totalLineCount = lines.length;
9393

94-
const batchSize = Math.floor(this.totalLineCount / 10);
94+
const batchSize = Math.max(1, Math.floor((this.totalLineCount - 2) / 10));
9595
const self = this;
9696

9797
// Throttle the advancementCallback to reduce frequent UI updates

0 commit comments

Comments
 (0)