]> cat aescling's git repositories - mastodon.git/commitdiff
Fix compose form bug
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 5 Jan 2017 13:18:38 +0000 (14:18 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 5 Jan 2017 13:18:38 +0000 (14:18 +0100)
app/assets/javascripts/components/features/compose/components/compose_form.jsx

index 8128bb382afbfc7b9e7685eb489ee226ff7cbb46..5a76b177b689db7c1b9c048d4289fe96eed3e178 100644 (file)
@@ -85,7 +85,7 @@ const ComposeForm = React.createClass({
   },
 
   componentDidUpdate (prevProps) {
-    if (!prevProps.in_reply_to || !this.props.in_reply_to || prevProps.in_reply_to.get('id') !== this.props.in_reply_to.get('id')) {
+    if ((!prevProps.in_reply_to && this.props.in_reply_to) || prevProps.in_reply_to.get('id') !== this.props.in_reply_to.get('id')) {
       // If replying to zero or one users, places the cursor at the end of the textbox.
       // If replying to more than one user, selects any usernames past the first;
       // this provides a convenient shortcut to drop everyone else from the conversation.