Skip to content

Commit

Permalink
Enable runtime debug toggle in example; optionally chain
Browse files Browse the repository at this point in the history
  • Loading branch information
eweitz committed Nov 13, 2021
1 parent 1e05938 commit 1408dd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/vanilla/related-genes.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ <h1>Related genes | Ideogram</h1>
// annotsInList = ['CDK9', 'CDK19', 'CDK1'];
// let ideogram = Ideogram.initRelatedGenes(config, annotsInList)
let ideogram;

if ('debug' in urlParams) config.debug = true;
if ('q' in urlParams) {
ideogram = Ideogram.initRelatedGenes(config);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/js/gene-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default async function initGeneCache(orgName, ideo, cacheDir=null) {
if (!hasGeneCache(orgName)) return;

// Skip initialization if cache is already populated
if (Ideogram.geneCache && Ideogram.geneCache[orgName]) {
if (Ideogram.geneCache?.[orgName]) {
// Simplify chief use case, i.e. for single organism
ideo.geneCache = Ideogram.geneCache[orgName];
return;
Expand Down

0 comments on commit 1408dd8

Please sign in to comment.