Skip to content

Commit

Permalink
Set injected_data with only whitespace to false
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolan Woods committed Mar 8, 2021
1 parent 92e7b1e commit 6bb0497
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
25 changes: 17 additions & 8 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import Newick from './newick'
$(document).ready(function() {
const query = new URLSearchParams(location.search);
const dataset_id = query.get('dataset_id');
const injected_data = document.getElementById('injected_data').textContent;
let injected_data = document.getElementById('injected_data').textContent;
if (/^\s+$/.test(injected_data)) injected_data = false;

// Allow specifying full src path in query or fall back to galaxy dataset path
const src = (injected_data && atob(injected_data)) || query.get('src') || (dataset_id && `/datasets/${dataset_id}/display`);
Expand Down

0 comments on commit 6bb0497

Please sign in to comment.