Fixed comment votes issue

This commit is contained in:
Mustafa Buyukcelebi 2019-10-16 13:55:31 +03:00
parent 5ebe01a29b
commit cac2cb7f9a
2 changed files with 15 additions and 4 deletions

View File

@ -166,6 +166,18 @@ class CommentsContainer extends Component {
});
};
_handleOnVotersPress = activeVotes => {
const { navigation, content } = this.props;
navigation.navigate({
routeName: ROUTES.SCREENS.VOTERS,
params: {
activeVotes,
},
key: get(content, 'permlink'),
});
};
_handleOnEditPress = item => {
const { navigation } = this.props;
@ -258,6 +270,7 @@ class CommentsContainer extends Component {
handleOnPressCommentMenu={this._handleOnPressCommentMenu}
isOwnProfile={isOwnProfile}
isHideImage={isHideImage}
handleOnVotersPress={this._handleOnVotersPress}
/>
);
}

View File

@ -105,9 +105,7 @@ export const parseComments = async (comments, currentUserName) => {
.filter(item => item.includes('Posted using [Partiko') === false)
.join('\n');
}
comment.pending_payout_value = parseFloat(
get(comment, 'pending_payout_value') ? get(comment, 'pending_payout_value') : 0,
).toFixed(3);
comment.pending_payout_value = parseFloat(get(comment, 'pending_payout_value', 0)).toFixed(3);
comment.author_reputation = getReputation(get(comment, 'author_reputation'));
comment.avatar = getResizedAvatar(get(comment, 'author'));
comment.markdownBody = get(comment, 'body');
@ -162,7 +160,7 @@ const parseActiveVotes = (post, currentUserName) => {
post.total_payout = totalPayout.toFixed(3);
const voteRshares = post.active_votes.reduce((a, b) => a + parseFloat(b.rshares), 0);
const ratio = totalPayout / voteRshares;
const ratio = totalPayout / voteRshares || 0;
if (!isEmpty(post.active_votes)) {
forEach(post.active_votes, value => {