From 320d578e519f6f31923dc96bc196a6c6f812278e Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Sat, 4 Nov 2017 14:04:49 +0100 Subject: [PATCH] :gear: Transformer unfoldedSteps en currentQuestion --- source/components/conversation/Conversation.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/components/conversation/Conversation.js b/source/components/conversation/Conversation.js index 1818956df..f7667c5ad 100644 --- a/source/components/conversation/Conversation.js +++ b/source/components/conversation/Conversation.js @@ -11,7 +11,8 @@ import Scroll from 'react-scroll' }) export default class Conversation extends Component { render() { - let {foldedSteps, unfoldedSteps, extraSteps, reinitalise, situation, situationGate, textColourOnWhite} = this.props + let {foldedSteps, unfoldedSteps, extraSteps, reinitalise, situation, situationGate, textColourOnWhite} = this.props, + currentQuestion = R.head(unfoldedSteps) ? R.head(unfoldedSteps) : null Scroll.animateScroll.scrollToBottom() return ( @@ -56,8 +57,8 @@ export default class Conversation extends Component { }
- { !R.isEmpty(unfoldedSteps) && do { - let step = R.head(unfoldedSteps) + { currentQuestion && do { + let step = currentQuestion ; }}
- {R.isEmpty(unfoldedSteps) && + {!currentQuestion && }