diff --git a/src/actions/index.js b/src/actions/index.js index 1264aa2..24d2a6d 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -97,7 +97,6 @@ export function fetchDomain () { sourcesPromise ]) .then(response => { - dispatch(toggleFetchingDomain()) const result = { events: response[0], categories: response[1], @@ -107,11 +106,16 @@ export function fetchDomain () { sources: response[5], notifications } + if (Object.values(result).some(resp => resp.hasOwnProperty('error'))) { + throw new Error('Some URLs returned negative. If you are in development, check the server is running') + } return result }) .catch(err => { dispatch(fetchError(err.message)) dispatch(toggleFetchingDomain()) + // TODO: handle this appropriately in React hierarchy + alert(err.message) }) }; } diff --git a/src/components/Card.jsx b/src/components/Card.jsx index b85a144..35def13 100644 --- a/src/components/Card.jsx +++ b/src/components/Card.jsx @@ -129,11 +129,11 @@ class Card extends React.Component { renderHeader() { return (
in:{` ${locationName}`}
) - } - return ''; - } - renderCardStackHeader() { const header_lang = copy[this.props.language].cardstack.header; diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index 479be0a..a462491 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -22,7 +22,7 @@ class Dashboard extends React.Component { this.handleHighlight = this.handleHighlight.bind(this); this.handleSelect = this.handleSelect.bind(this); - // this.handleToggle = this.handleToggle.bind(this); + this.handleSelectNarrative = this.handleSelectNarrative.bind(this); this.handleTagFilter = this.handleTagFilter.bind(this); this.updateTimerange = this.updateTimerange.bind(this); @@ -55,6 +55,10 @@ class Dashboard extends React.Component { } } + handleSelectNarrative(narrative) { + this.props.actions.updateNarrative(narrative); + } + handleTagFilter(tag) { this.props.actions.updateTagFilters(tag); } @@ -76,23 +80,18 @@ class Dashboard extends React.Component { render() { return ({this.props.narrative.description}
--
{info_lang}
-{date0} - {date1}
-Here are some highlighted stories
+{copy[this.props.language].toolbar.narrative_summary}
{this.props.narratives.map((narr) => { return (+
{title}
+{date0} - {date1}
+