diff --git a/src/components/Layout.js b/src/components/Layout.js index 6c1ce26..7d4db2e 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -76,7 +76,11 @@ class Dashboard extends React.Component { setNarrative (narrative) { // only handleSelect if narrative is not null - if (narrative) { this.handleSelect([ narrative.steps[0] ]) } + if (narrative) { + this.props.actions.clearFilter('tags') + this.props.actions.clearFilter('categories') + this.handleSelect([ narrative.steps[0] ]) + } this.props.actions.updateNarrative(narrative) } diff --git a/src/reducers/app.js b/src/reducers/app.js index 9fc7d0d..b47db77 100644 --- a/src/reducers/app.js +++ b/src/reducers/app.js @@ -144,6 +144,15 @@ function toggleFilter (appState, action) { } } +function clearFilter (appState, action) { + return { + ...appState, + filters: { + ...appState.filters, + [action.filter]: [] + } + } +} function updateTimeRange (appState, action) { // XXX return {