Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Maryia/84861/fix: prevent selling off accumulators same like multipli…
Browse files Browse the repository at this point in the history
…ers (#7325)

* fix: prevent selling off accumulators same as multipliers

* style: prettifying

* chore: added contract type name + padding

---------

Co-authored-by: Matin shafiei <[email protected]>
  • Loading branch information
maryia-deriv and matin-deriv authored Feb 1, 2023
1 parent e80f1d5 commit 1b01875
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/javascript/app/pages/user/view_popup/view_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const Utility = require('../../../../_common/utility');
const ViewPopup = (() => {
let contract_id,
contract,
is_accumulator_contract,
is_multiplier_contract,
is_sold,
is_sold_before_start,
Expand Down Expand Up @@ -75,6 +76,7 @@ const ViewPopup = (() => {
// Lookback multiplier value
multiplier = contract.multiplier;
is_multiplier_contract = /MULTDOWN|MULTUP/.test(contract.contract_type);
is_accumulator_contract = /ACCU/.test(contract.contract_type);

if (contract && document.getElementById(wrapper_id)) {
update();
Expand All @@ -88,6 +90,7 @@ const ViewPopup = (() => {
let contract_type_display;

const initContractTypeDisplay = () => ({
ACCU : localize('Accumulator'),
ASIANU : localize('Asian Up'),
ASIAND : localize('Asian Down'),
CALL : localize('Higher'),
Expand Down Expand Up @@ -254,7 +257,9 @@ const ViewPopup = (() => {
);
}

const is_unsupported_contract = is_multiplier_contract || Callputspread.isCallputspread(contract.contract_type);
const is_unsupported_contract = is_accumulator_contract
|| is_multiplier_contract
|| Callputspread.isCallputspread(contract.contract_type);
if (!is_started) {
containerSetText('trade_details_entry_spot > span', '-');
containerSetText('trade_details_message', localize('Contract has not started yet'));
Expand Down
1 change: 1 addition & 0 deletions src/sass/app/sell_popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
font-style: italic;
}
#trade_details_bottom {
padding-bottom: 20px;
@media screen and (max-width: 480px) {
padding-bottom: 25px;
}
Expand Down

1 comment on commit 1b01875

@vercel
Copy link

@vercel vercel bot commented on 1b01875 Feb 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

binary-static – ./

binary-static.binary.sx
binary-static-git-master.binary.sx

Please sign in to comment.