Skip to content
Permalink
Browse files

Fix bug in computing state when nodes lack num_date attributes

The getMinCalDateViaTree function is used to initialize state of the date slider by getting the date of the root node. If the root node lacks the "num_date" attribute, the min date is set based on default date range. This default needs to be returned as a calendar date however.
  • Loading branch information
trvrb committed Jan 11, 2020
1 parent 0a018c4 commit 3e5124d3a1c54ff013a63e9fe0cd21cf7f7084bd
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/actions/recomputeReduxState.js
@@ -26,7 +26,7 @@ export const getMinCalDateViaTree = (nodes, state) => {
/* if no date, use some default dates - slider will not be visible */
const minNumDate = getTraitFromNode(nodes[0], "num_date");
return (minNumDate === undefined) ?
state.dateMaxNumeric - defaultDateRange :
numericToCalendar(state.dateMaxNumeric - defaultDateRange) :
numericToCalendar(minNumDate - 0.01);
};

0 comments on commit 3e5124d

Please sign in to comment.
You can’t perform that action at this time.