mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-13 05:48:36 +03:00
clear tags and categories when switching to narrative
This commit is contained in:
@@ -76,7 +76,11 @@ class Dashboard extends React.Component {
|
|||||||
|
|
||||||
setNarrative (narrative) {
|
setNarrative (narrative) {
|
||||||
// only handleSelect if narrative is not null
|
// 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)
|
this.props.actions.updateNarrative(narrative)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,6 +144,15 @@ function toggleFilter (appState, action) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearFilter (appState, action) {
|
||||||
|
return {
|
||||||
|
...appState,
|
||||||
|
filters: {
|
||||||
|
...appState.filters,
|
||||||
|
[action.filter]: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateTimeRange (appState, action) { // XXX
|
function updateTimeRange (appState, action) { // XXX
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user