Skip to content

Commit

Permalink
don't show empty values for claim op (steemit#1348)
Browse files Browse the repository at this point in the history
* don't show empty values for claim op
  • Loading branch information
roadscape authored Apr 19, 2017
1 parent b93d736 commit 35e5b2e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion app/components/cards/TransferHistoryRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,26 @@ class TransferHistoryRow extends React.Component {
// other_account = ``;
description_end = '';
} else if (type === 'claim_reward_balance') {
description_start += `Claim rewards: ${data.reward_sbd}, ${data.reward_steem}, and ${reward_vests} STEEM POWER`;

let rewards = [];
if(parseFloat(data.reward_steem.split(' ')[0]) > 0) rewards.push(data.reward_steem);
if(parseFloat(data.reward_sbd.split(' ')[0]) > 0) rewards.push(data.reward_sbd);
if(parseFloat(data.reward_vests.split(' ')[0]) > 0) rewards.push(`${reward_vests} STEEM POWER`);

let rewards_str;
switch(rewards.length) {
case 3:
rewards_str = `${rewards[0]}, ${rewards[1]} and ${rewards[2]}`;
break;
case 2:
rewards_str = `${rewards[0]} and ${rewards[1]}`;
break;
case 1:
rewards_str = `${rewards[0]}`;
break;
}

description_start += `Claim rewards: ${rewards_str}`;
description_end = '';
} else if (type === 'interest') {
description_start += `Receive interest of ${data.interest}`;
Expand Down

0 comments on commit 35e5b2e

Please sign in to comment.