Merge pull request #1989 from ecency/nt/bug-fixes

Nt/bug fixes
This commit is contained in:
Feruz M 2021-07-09 22:11:59 +03:00 committed by GitHub
commit a073a34873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 10 deletions

View File

@ -87,11 +87,8 @@ const UpvoteContainer = (props) => {
incrementVoteCount();
}
if (isDownvote) {
setIsDownVoted(true);
} else {
setIsVoted(true);
}
setIsDownVoted(isDownvote ? true : false);
setIsVoted(isDownvote ? false : true);
}
};
@ -105,11 +102,8 @@ const UpvoteContainer = (props) => {
incrementVoteCount();
}
if (isDownvote) {
setIsDownVoted(true);
} else {
setIsVoted(true);
}
setIsDownVoted(isDownvote ? true : false);
setIsVoted(isDownvote ? false : true);
setTotalPayout(totalPayout + amountNum);
//update redux

View File

@ -260,6 +260,7 @@ class ProfileContainer extends Component {
};
_fetchProfile = async (username = null, isProfileAction = false) => {
const { intl } = this.props;
try {
const { username: _username, isFollowing, isMuted, isOwnProfile } = this.state;

View File

@ -435,6 +435,13 @@ class EditorContainer extends Component {
id: 'alert.permission_text',
}),
);
}else{
Alert.alert(
intl.formatMessage({
id: 'alert.fail',
}),
error.message,
);
}
};

View File

@ -82,6 +82,14 @@ export const parseComments = async (comments) => {
comment.markdownBody = get(comment, 'body');
comment.body = renderPostBody(comment, true, webp);
//calculate and set total_payout to show to user.
const totalPayout =
parseAsset(comment.pending_payout_value).amount +
parseAsset(comment.author_payout_value).amount +
parseAsset(comment.curator_payout_value).amount;
comment.total_payout = totalPayout;
//stamp comments with fetched time;
comment.post_fetched_at = new Date().getTime();