mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-30 00:52:42 +03:00
Merge pull request #1221 from esteemapp/bugfix/comment-voter
Fixed comment votes issue
This commit is contained in:
commit
5e53760ae2
@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -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 => {
|
||||
|
Loading…
Reference in New Issue
Block a user