Handling case where child and parent_id are undefined.

This commit is contained in:
David Jay
2016-12-06 12:53:35 -05:00
parent 0e75319c04
commit 582c0c0c9e
+3 -1
View File
@@ -39,7 +39,9 @@ class CommentBox extends Component {
related = 'comments';
parent_type = 'assets';
}
updateItem(child_id || parent_id, 'showReply', false, 'comments');
if (child_id || parent_id) {
updateItem(child_id || parent_id, 'showReply', false, 'comments');
}
postItem(comment, 'comments')
.then(({comment_id, status}) => {
if (status === 'rejected') {