Skip to content

Commit

Permalink
simplify if/else a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegZharkov committed May 20, 2021
1 parent fc2de2c commit a002b75
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export default {
Toast.info("You must select at least one dataset to download");
return;
}
download(format, datasets, folders);
});
},
Expand All @@ -305,7 +306,8 @@ export default {
const folders = [];
const selected = await this.getSelected();
selected.forEach((item) => {
item.type === "file" ? datasets.push(idOnly ? item.id : item) : folders.push(idOnly ? item.id : item);
const selected_item = idOnly ? item.id : item;
item.type === "file" ? datasets.push(selected_item) : folders.push(selected_item);
});
return { datasets: datasets, folders: folders };
},
Expand Down

0 comments on commit a002b75

Please sign in to comment.