Fixed comment crash error

This commit is contained in:
Mustafa Buyukcelebi 2019-01-16 13:17:58 +03:00
parent 461223c543
commit c1f7fafae9
4 changed files with 13 additions and 5 deletions

View File

@ -55,14 +55,14 @@ class CommentsContainer extends Component {
}; };
_handleOnReplyPress = (item) => { _handleOnReplyPress = (item) => {
const { navigation } = this.props; const { navigation, fetchPost } = this.props;
navigation.navigate({ navigation.navigate({
routeName: ROUTES.SCREENS.EDITOR, routeName: ROUTES.SCREENS.EDITOR,
params: { params: {
isReply: true, isReply: true,
post: item, post: item,
fetchPost: this._getComments, fetchPost,
}, },
}); });
}; };
@ -84,7 +84,13 @@ class CommentsContainer extends Component {
render() { render() {
const { comments: _comments } = this.state; const { comments: _comments } = this.state;
const { const {
isLoggedIn, commentCount, author, permlink, currentAccount, isProfilePreview, comments, isLoggedIn,
commentCount,
author,
permlink,
currentAccount,
isProfilePreview,
comments,
} = this.props; } = this.props;
return ( return (

View File

@ -419,7 +419,7 @@ class EditorContainer extends Component {
intl.formatMessage({ intl.formatMessage({
id: 'alert.fail', id: 'alert.fail',
}), }),
error, error.message || error.toString(),
); );
this.setState({ isPostSending: false }); this.setState({ isPostSending: false });
}; };

View File

@ -346,6 +346,7 @@ class ProfileContainer extends Component {
selectedQuickProfile={selectedQuickProfile} selectedQuickProfile={selectedQuickProfile}
selectedUser={user} selectedUser={user}
username={username} username={username}
getReplies={this._getReplies}
/> />
</Fragment> </Fragment>
); );

View File

@ -73,6 +73,7 @@ class ProfileScreen extends PureComponent {
selectedQuickProfile, selectedQuickProfile,
selectedUser, selectedUser,
username, username,
getReplies,
} = this.props; } = this.props;
const { isSummaryOpen, collapsibleMoreHeight } = this.state; const { isSummaryOpen, collapsibleMoreHeight } = this.state;
@ -182,7 +183,7 @@ class ProfileScreen extends PureComponent {
> >
{comments && comments.length > 0 ? ( {comments && comments.length > 0 ? (
<ScrollView> <ScrollView>
<Comments isProfilePreview comments={comments} /> <Comments isProfilePreview comments={comments} fetchPost={getReplies} />
</ScrollView> </ScrollView>
) : ( ) : (
<NoPost <NoPost