Skip to content

Commit

Permalink
AG-1425 code cleanup for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 committed May 13, 2024
1 parent 83dc635 commit d3940fa
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy {
// on initial load, we want to cache any items
if (this.initialLoad) {
this.initialLoad = false;
this.setPinnedGenesCache(itemsToPin);
this.setPinnedItemsCache(itemsToPin);
}

this.uniquePinnedGenesCount = this.getCountOfUniqueGenes();
Expand Down Expand Up @@ -679,17 +679,17 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy {
.toLowerCase();
}

setPinnedGenesCache(genes: GCTGene[]) {
setPinnedItemsCache(genes: GCTGene[]) {
this.pinnedItemsCache = genes;
}

clearPinnedGenesCache() {
clearPinnedItemsCache() {
this.pinnedItemsCache = [];
this.uniquePinnedGenesCount = this.getCountOfUniqueGenes();
}

refreshPinnedGenes() {
this.setPinnedGenesCache(this.pinnedItems);
this.setPinnedItemsCache(this.pinnedItems);
this.filter();
this.updateUrl();
}
Expand Down Expand Up @@ -734,7 +734,7 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy {
this.uniquePinnedGenesCount = this.getCountOfUniqueGenes();

if (refresh) {
this.clearPinnedGenesCache();
this.clearPinnedItemsCache();
this.refreshPinnedGenes();
}
}
Expand Down Expand Up @@ -871,7 +871,7 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy {
this.pinnedItems.splice(index, 1);

if (refresh) {
this.clearPinnedGenesCache();
this.clearPinnedItemsCache();
this.refreshPinnedGenes();
}

Expand All @@ -886,7 +886,7 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy {

clearPinnedGenes() {
this.pinnedItems = [];
this.clearPinnedGenesCache();
this.clearPinnedItemsCache();
this.refreshPinnedGenes();
}

Expand All @@ -902,7 +902,7 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy {
if (this.category === 'RNA - Differential Expression')
return this.pinnedItems.length >= this.maxPinnedGenes;
else {
// default to showing pin all button for protein view
// default to showing pin/pin all button for protein view
return false;
}
}
Expand Down

0 comments on commit d3940fa

Please sign in to comment.