From 49f8d039687b8b0831bee61e157ff224cdd71a08 Mon Sep 17 00:00:00 2001 From: Jordi Date: Fri, 5 Apr 2024 15:56:51 +0200 Subject: [PATCH] download.js: Fix download the newick of the full tree from the main menu. 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. --- ete4/smartview/gui/static/js/download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ete4/smartview/gui/static/js/download.js b/ete4/smartview/gui/static/js/download.js index 2ab404092..cf8a63eb7 100644 --- a/ete4/smartview/gui/static/js/download.js +++ b/ete4/smartview/gui/static/js/download.js @@ -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); }