Skip to content

Commit

Permalink
Remove props antipattern
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLitt committed Jul 15, 2015
1 parent 1009a62 commit 1eef3b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/components/conversation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ var Conversation = React.createClass({
submitted: false,
text: null, // this.props.conversation && this.props.conversation.text || 'Error: Text not found',
title: null, // this.props.conversation && this.props.conversation.title || 'No Title',
hideButton: false,
author: this.props.account
hideButton: false
}
},
onClick: function () {
// TODO Make sure that userId and id should be the same
// Shim the author ID.
var author = {}
if (this.state.author) {
author.id = this.state.author.userId
if (this.props.account) {
author.id = this.props.account.userId
} else {
// TODO Log in the user programmatically automatically
throw new Error('You must log in before saving a conversation')
Expand Down

0 comments on commit 1eef3b5

Please sign in to comment.