Skip to content

Commit

Permalink
Merge pull request #78 from zakibinary/fix_sold_payout_reports_drawer
Browse files Browse the repository at this point in the history
zaki/fix_sold_payout_reports_drawer
  • Loading branch information
negarn committed May 21, 2019
2 parents fcfb35c + 391d484 commit cf3ccb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ class ContractDrawer extends Component {
currency,
exit_tick,
is_sold,
payout,
profit,
sell_price,
} = this.props.contract_info;
const { contract_info } = this.props;
const exit_spot = isUserSold(contract_info) ? '-' : exit_tick;

return (
<ContractCard contract_info={contract_info}>
<ContractCardHeader>
Expand All @@ -64,7 +63,7 @@ class ContractDrawer extends Component {
<ContractCardBody>
<ProfitLossCardContent
pl_value={+profit}
payout={+payout}
payout={+sell_price}
currency={currency}
/>
</ContractCardBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class PositionsDrawerCard extends React.PureComponent {
onClickRemove,
openContract,
result,
sell_price,
sell_time,
server_time,
status,
Expand Down Expand Up @@ -136,7 +137,7 @@ class PositionsDrawerCard extends React.PureComponent {
</div>
</div>
<div className='positions-drawer-card__indicative'>
<Money amount={indicative} currency={currency} />
<Money amount={sell_price || indicative} currency={currency} />
<div className={classNames(
'positions-drawer-card__indicative--movement', {
'positions-drawer-card__indicative--movement-complete': !!result,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export default class PortfolioStore extends BaseStore {
this.positions[i].is_valid_to_sell = isValidToSell(contract_response);
this.positions[i].result = getDisplayStatus(contract_response);
this.positions[i].sell_time = getEndTime(contract_response) || contract_response.current_spot_time; // same as exit_spot, use latest spot time if no exit_tick_time
this.positions[i].sell_price = contract_response.sell_price;
this.positions[i].status = 'complete';
// fix for missing barrier and entry_spot
Expand Down

0 comments on commit cf3ccb1

Please sign in to comment.