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

fix: Change Rise/Fall contract from displaying Higher/Lower #7312

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/javascript/app/pages/trade/price.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,18 @@ const Price = (() => {
const currency = CommonFunctions.getVisibleElement('currency');

if (!h4) return;
const display_text = type && contract_type ? contract_type[type] : '';

const form_name = Defaults.get('formname');
let display_text = type && contract_type ? contract_type[type] : '';

if (form_name === 'risefall' || form_name === 'callputequal') {
if (type === 'CALL' || type === 'CALLE') {
display_text = localize('Rise');
} else {
display_text = localize('Fall');
}
}

if (display_text) {
h4.setAttribute('class', `contract_heading ${type}`);
CommonFunctions.elementTextContent(h4, display_text);
Expand Down
28 changes: 10 additions & 18 deletions src/javascript/app/pages/user/view_popup/view_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const moment = require('moment');
const ViewPopupUI = require('./view_popup.ui');
const Highchart = require('../../trade/charts/highchart');
const Callputspread = require('../../trade/callputspread');
const Defaults = require('../../trade/defaults');
const DigitDisplay = require('../../trade/digit_trade');
const Lookback = require('../../trade/lookback');
const Reset = require('../../trade/reset');
Expand Down Expand Up @@ -86,17 +87,17 @@ const ViewPopup = (() => {
showContract();
};

const ContractTypeDisplay = (() => {
let contract_type_display;
const ContractTypeDisplay = () => {
const form_name = Defaults.get('formname');

const initContractTypeDisplay = () => ({
return {
ACCU : localize('Accumulator'),
ASIANU : localize('Asian Up'),
ASIAND : localize('Asian Down'),
CALL : localize('Higher'),
CALLE : localize('Higher or equal'),
PUT : localize('Lower'),
PUTE : localize('Lower or equal'),
CALL : form_name === 'risefall' ? localize('Rise') : localize('Higher'),
CALLE : localize('Rise or equal'),
PUT : form_name === 'risefall' ? localize('Fall') : localize('Lower'),
PUTE : localize('Fall or equal'),
DIGITMATCH : localize('Digit Matches'),
DIGITDIFF : localize('Digit Differs'),
DIGITODD : localize('Digit Odd'),
Expand All @@ -123,24 +124,15 @@ const ViewPopup = (() => {
RUNLOW : localize('Only Downs'),
MULTUP : localize('Multiplier Up'),
MULTDOWN : localize('Multiplier Down'),
});

return {
get: () => {
if (!contract_type_display) {
contract_type_display = initContractTypeDisplay();
}
return contract_type_display;
},
henry-deriv marked this conversation as resolved.
Show resolved Hide resolved
};
})();
};

const showContract = () => {
if (!$container) {
$container = makeTemplate();
}

containerSetText('trade_details_contract_type', ContractTypeDisplay.get()[contract.contract_type]);
containerSetText('trade_details_contract_type', ContractTypeDisplay()[contract.contract_type]);
containerSetText('trade_details_purchase_price', formatMoney(contract.currency, contract.buy_price));
containerSetText('trade_details_multiplier', formatMoney(contract.currency, multiplier, false, 3, 2));
if (Lookback.isLookback(contract.contract_type)) {
Expand Down
6 changes: 3 additions & 3 deletions src/templates/app/trade/explanation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ const Explanation = () => (

<div id='winning_risefall' className='invisible'>
<h3>{it.L('Winning the contract')}</h3>
<p>{it.L('If you select "Higher", you win the payout if the <strong>exit spot</strong> is strictly higher than the <strong>entry spot</strong>.')}</p>
<p>{it.L('If you select "Lower", you win the payout if the <strong>exit spot</strong> is strictly lower than the <strong>entry spot</strong>.')}</p>
<p>{it.L('If you select "Allow equals", you win the payout if exit spot is higher than or equal to entry spot for "Higher". Similarly, you win the payout if exit spot is lower than or equal to entry spot for "Lower".')}</p>
<p>{it.L('If you select "Rise", you win the payout if the <strong>exit spot</strong> is strictly higher than the <strong>entry spot</strong>.')}</p>
<p>{it.L('If you select "Fall", you win the payout if the <strong>exit spot</strong> is strictly lower than the <strong>entry spot</strong>.')}</p>
<p>{it.L('If you select "Allow equals", you win the payout if exit spot is higher than or equal to entry spot for "Rise". Similarly, you win the payout if exit spot is lower than or equal to entry spot for "Fall".')}</p>
</div>

<div id='winning_runbet-lucky10' className='invisible'>
Expand Down