Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix vote value #2143

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/client/helpers/user.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { calculateVoteValue } from '../vendor/steemitHelpers';
import { calculateVoteValue, calculateVotingPower } from '../vendor/steemitHelpers';

export const getUserRank = vests => {
let rank = 'Plankton';
Expand Down Expand Up @@ -30,8 +30,9 @@ export const getUserRankKey = vests => {

export const getTotalShares = user =>
parseFloat(user.vesting_shares) +
parseFloat(user.received_vesting_shares) +
-parseFloat(user.delegated_vesting_shares);
parseFloat(user.received_vesting_shares) -
parseFloat(user.delegated_vesting_shares) -
parseFloat(user.vesting_withdraw_rate);

export const getHasDefaultSlider = user => getTotalShares(user) >= 10000000;

Expand All @@ -41,7 +42,7 @@ export const getVoteValue = (user, recentClaims, rewardBalance, rate, weight = 1
parseFloat(recentClaims),
parseFloat(rewardBalance),
rate,
user.voting_power,
calculateVotingPower(user) * 10000,
weight,
);

Expand Down