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

View File

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

View File

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

View File

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