diff --git a/src/actions/recomputeReduxState.js b/src/actions/recomputeReduxState.js index 6bc9683f0..9962b7bc8 100644 --- a/src/actions/recomputeReduxState.js +++ b/src/actions/recomputeReduxState.js @@ -274,7 +274,12 @@ const checkAndCorrectErrorsInState = (state, metadata, query) => { if (availableNonGenotypeColorBys.indexOf("gt") > -1) { availableNonGenotypeColorBys.splice(availableNonGenotypeColorBys.indexOf("gt"), 1); } - if (availableNonGenotypeColorBys.length) { + + if (metadata.defaults && metadata.defaults.colorBy && availableNonGenotypeColorBys.indexOf(metadata.defaults.colorBy) !== -1) { + console.warn("colorBy falling back to", metadata.defaults.colorBy); + state.colorBy = metadata.defaults.colorBy; + state.defaults.colorBy = metadata.defaults.colorBy; + } else if (availableNonGenotypeColorBys.length) { console.error("Error detected trying to set colorBy to", state.colorBy, "falling back to", availableNonGenotypeColorBys[0]); state.colorBy = availableNonGenotypeColorBys[0]; state.defaults.colorBy = availableNonGenotypeColorBys[0];