Skip to content

Commit

Permalink
fix powerdown-amount (#2160)
Browse files Browse the repository at this point in the history
Fix #2159
  • Loading branch information
economicstudio authored and Sekhmet committed Jan 23, 2019
1 parent 3162d6e commit c914d0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/client/helpers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export const getTotalShares = user =>
parseFloat(user.vesting_shares) +
parseFloat(user.received_vesting_shares) -
parseFloat(user.delegated_vesting_shares) -
parseFloat(user.vesting_withdraw_rate);
Math.min(
parseFloat(user.vesting_withdraw_rate),
(parseFloat(user.to_withdraw) - parseFloat(user.withdrawn)) / 100000,
);

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

Expand Down
9 changes: 8 additions & 1 deletion src/client/vendor/steemitHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,14 @@ export const calculateTotalDelegatedSP = (user, totalVestingShares, totalVesting

export const calculatePendingWithdrawalSP = (user, totalVestingShares, totalVestingFundSteem) => {
return parseFloat(
formatter.vestToSteem(user.vesting_withdraw_rate, totalVestingShares, totalVestingFundSteem),
formatter.vestToSteem(
Math.min(
parseFloat(user.vesting_withdraw_rate),
(parseFloat(user.to_withdraw) - parseFloat(user.withdrawn)) / 100000,
),
totalVestingShares,
totalVestingFundSteem,
),
);
};

Expand Down

0 comments on commit c914d0b

Please sign in to comment.