Skip to content

Commit

Permalink
download.js: Fix download the newick of the full tree from the main m…
Browse files Browse the repository at this point in the history
…enu.

The function download_newick() expected always a node_id, which was
not used by the button "download -> newick" in the menu.

This change makes it request the full tree if the function is called without
a node_id.
  • Loading branch information
jordibc committed Apr 5, 2024
1 parent bee42aa commit 49f8d03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ete4/smartview/gui/static/js/download.js
Expand Up @@ -10,7 +10,7 @@ export { download_newick, download_seqs, download_svg, download_pdf };

// Download a file with the newick representation of the tree.
async function download_newick(node_id) {
const nid = get_tid() + (node_id.length > 0 ? ("," + node_id) : "");
const nid = get_tid() + (node_id && node_id.length > 0 ? ("," + node_id) : "");
const newick = await api(`/trees/${nid}/newick`);
download(view.tree + ".tree", "data:text/plain;charset=utf-8," + newick);
}
Expand Down

0 comments on commit 49f8d03

Please sign in to comment.