Skip to content

Commit

Permalink
forget for buy in sell if sold
Browse files Browse the repository at this point in the history
  • Loading branch information
negar-binary committed Jun 25, 2019
1 parent 842d549 commit 38b720a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default class PortfolioStore extends BaseStore {
portfolio_position.status = null;
}
if (isEnded(proposal)) {
if (isEnded(proposal) && !isUserSold(proposal)) { // if sold, forget will happen after handling sell
WS.forget('proposal_open_contract', this.proposalOpenContractHandler, { contract_id: proposal.contract_id });
}
}
Expand Down Expand Up @@ -190,7 +190,10 @@ export default class PortfolioStore extends BaseStore {
this.positions[i].is_loading = false;
if (isEnded(contract_response)) {
WS.forget('proposal_open_contract', this.populateResultDetails, { contract_id: contract_response.contract_id });
// also forget for buy
[this.populateResultDetails, this.proposalOpenContractHandler].forEach(cb => {
WS.forget('proposal_open_contract', cb, { contract_id: contract_response.contract_id });
});
}
};
Expand Down

0 comments on commit 38b720a

Please sign in to comment.