From 77ceac1ee18dff3cb719038a1aef4ab6b7d2d50d Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 28 Jan 2017 16:39:17 -0500 Subject: [PATCH] reuse authorizedToEdit --- frontend/src/components/TopicCard/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/TopicCard/index.js b/frontend/src/components/TopicCard/index.js index 9b8a2940..a7603257 100644 --- a/frontend/src/components/TopicCard/index.js +++ b/frontend/src/components/TopicCard/index.js @@ -8,7 +8,7 @@ import Attachments from './Attachments' class ReactTopicCard extends Component { render = () => { const { topic, ActiveMapper } = this.props - var authorizedToEdit = topic.authorizeToEdit(ActiveMapper) + const authorizedToEdit = topic.authorizeToEdit(ActiveMapper) const hasAttachment = topic.get('link') && topic.get('link') !== '' const topicId = topic.isNew() ? topic.cid : topic.id // TODO should we be using cid here??? @@ -24,15 +24,15 @@ class ReactTopicCard extends Component {
<Links topic={topic} ActiveMapper={this.props.ActiveMapper} updateTopic={this.props.updateTopic} /> <Desc desc={topic.get('desc')} - authorizedToEdit={topic.authorizeToEdit(ActiveMapper)} + authorizedToEdit={authorizedToEdit} onChange={this.props.updateTopic} /> <Attachments topic={this.props.topic}