mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 05:18:34 +03:00
Rebase with cleaning up fetchingEvents actions
This commit is contained in:
@@ -49,9 +49,8 @@ class Dashboard extends React.Component {
|
||||
handleSelect(selected) {
|
||||
if (selected) {
|
||||
let eventsToSelect = selected.map(event => this.getEventById(event.id));
|
||||
const p = this.props.ui.tools.parser;
|
||||
|
||||
eventsToSelect = eventsToSelect.sort((a, b) => p(a.timestamp) - p(b.timestamp))
|
||||
console.log(eventsToSelect, selected)
|
||||
eventsToSelect = eventsToSelect.sort((a, b) => parseDate(a.timestamp) - parseDate(b.timestamp))
|
||||
|
||||
this.props.actions.fetchSelected(eventsToSelect)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class NarrativeCard extends React.Component {
|
||||
componentDidUpdate() {
|
||||
if (this.props.narrative !== null) {
|
||||
const step = this.props.narrative.steps[this.state.step];
|
||||
this.props.onSelect([step.id]);
|
||||
this.props.onSelect([step]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class NarrativeCard extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.props.narrative !== null) {
|
||||
if (this.props.narrative !== null && this.props.narrative.steps[this.state.step]) {
|
||||
const steps = this.props.narrative.steps;
|
||||
const step = steps[this.state.step];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user