From 40ac0eb12048308100bbc4f453be4419d5fe4324 Mon Sep 17 00:00:00 2001 From: Franc Camps-Febrer Date: Fri, 14 Dec 2018 17:21:36 +0100 Subject: [PATCH] Only rerender NarrativeCard if step has changed --- src/components/Dashboard.jsx | 11 +++++++---- src/components/NarrativeCard.js | 11 ++++++++--- src/reducers/app.js | 1 - src/selectors/index.js | 1 - 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index 0f400db..286be0d 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -94,10 +94,13 @@ class Dashboard extends React.Component { getCategoryColor: category => this.getCategoryColor(category) }} /> - { this.props.actions.updateNarrative(narrative); }} - /> + {(this.props.app.narrative !== null) + ? { this.props.actions.updateNarrative(narrative); }} + /> + : '' + } { - console.log(selected, sources) if (selected.length === 0) { return [] }