diff --git a/.gitignore b/.gitignore
index 12b0846..4ce2e5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
build/
node_modules/
config.js
+dev.config.js
diff --git a/src/actions/index.js b/src/actions/index.js
index 77ead1b..e065b25 100644
--- a/src/actions/index.js
+++ b/src/actions/index.js
@@ -52,6 +52,10 @@ export function fetchDomain () {
.then(response => response.json())
.catch(handleError('categories'))
+ const narPromise = fetch(NARRATIVE_URL)
+ .then(response => response.json())
+ .catch(handleError('narratives'))
+
let sitesPromise = Promise.resolve([])
if (process.env.features.USE_SITES) {
sitesPromise = fetch(SITES_URL)
@@ -66,14 +70,16 @@ export function fetchDomain () {
.catch(handleError('tags'))
}
- return Promise.all([ eventPromise, catPromise, sitesPromise, tagsPromise])
+ return Promise.all([eventPromise, catPromise, narPromise,
+ sitesPromise, tagsPromise])
.then(response => {
dispatch(toggleFetchingDomain())
const result = {
events: response[0],
categories: response[1],
- sites: response[2],
- tags: response[3],
+ narratives: response[2],
+ sites: response[3],
+ tags: response[4],
notifications
}
return result
@@ -102,6 +108,7 @@ export function updateDomain(domain) {
categories: domain.categories,
tags: domain.tags,
sites: domain.sites,
+ narratives: domain.narratives,
notifications: domain.notifications
}
}
diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx
index 783fd78..1e758f2 100644
--- a/src/components/Dashboard.jsx
+++ b/src/components/Dashboard.jsx
@@ -67,7 +67,7 @@ class Dashboard extends React.Component {
}
getNarrativeLinks(event) {
- const narrative = this.props.domain.narratives.find(nv => nv.key === event.narrative);
+ const narrative = this.props.domain.narratives.find(nv => nv.id === event.narrative);
if (narrative) return narrative.byId[event.id];
return null;
}
diff --git a/src/components/Notification.jsx b/src/components/Notification.jsx
index 260befa..1bee1b9 100644
--- a/src/components/Notification.jsx
+++ b/src/components/Notification.jsx
@@ -48,7 +48,7 @@ export default class Notification extends React.Component{
return (
{this.props.notifications.map((notification) => {
-
+console.log(notification)
return (
this.toggleDetails() }>