Skip to content

Commit

Permalink
Merge pull request #904 from nextstrain/csv
Browse files Browse the repository at this point in the history
CSV drag-and-drop bugfixes
  • Loading branch information
jameshadfield authored Feb 25, 2020
2 parents de5703c + a3be6f3 commit eb53a25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/actions/filesDropped/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const handleMetadata = async (dispatch, getState, file) => {
try {
({data: csvData, errors, meta: csvMeta} = await parseCsv(file));
if (errors.length) {
console.error("Encountered the following errors during CSV parsing:", errors);
console.error(errors);
throw new Error(errors.map((e) => e.message).join(", "));
}
} catch (err) {
return dispatch(errorNotification({
Expand Down
3 changes: 2 additions & 1 deletion src/reducers/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ const Tree = (state = getDefaultTreeState(), action) => {
// modify the node data in place, which will not trigger any redux updates
state.nodes.forEach((node) => {
if (action.strains.has(node.name)) {
if (!node.node_attrs) node.node_attrs = {};
for (const [trait, obj] of Object.entries(action.traits[node.name])) {
node.traits[trait] = obj;
node.node_attrs[trait] = obj;
}
}
});
Expand Down

0 comments on commit eb53a25

Please sign in to comment.