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

Commit 8706dee

Browse files
author
HENRY
committed
fix: Change Rise/Fall contract from displaying Higher/Lower
1 parent eeb49cf commit 8706dee

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

src/javascript/app/pages/trade/price.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,18 @@ const Price = (() => {
197197
const currency = CommonFunctions.getVisibleElement('currency');
198198

199199
if (!h4) return;
200-
const display_text = type && contract_type ? contract_type[type] : '';
200+
201+
const form_name = Defaults.get('formname');
202+
let display_text = type && contract_type ? contract_type[type] : '';
203+
204+
if (form_name === 'risefall' || form_name === 'callputequal') {
205+
if (type === 'CALL' || type === 'CALLE') {
206+
display_text = localize('Rise');
207+
} else {
208+
display_text = localize('Fall');
209+
}
210+
}
211+
201212
if (display_text) {
202213
h4.setAttribute('class', `contract_heading ${type}`);
203214
CommonFunctions.elementTextContent(h4, display_text);

src/javascript/app/pages/user/view_popup/view_popup.js

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const moment = require('moment');
22
const ViewPopupUI = require('./view_popup.ui');
33
const Highchart = require('../../trade/charts/highchart');
44
const Callputspread = require('../../trade/callputspread');
5+
const Defaults = require('../../trade/defaults');
56
const DigitDisplay = require('../../trade/digit_trade');
67
const Lookback = require('../../trade/lookback');
78
const Reset = require('../../trade/reset');
@@ -84,16 +85,16 @@ const ViewPopup = (() => {
8485
showContract();
8586
};
8687

87-
const ContractTypeDisplay = (() => {
88-
let contract_type_display;
88+
const ContractTypeDisplay = () => {
89+
const form_name = Defaults.get('formname');
8990

90-
const initContractTypeDisplay = () => ({
91+
return {
9192
ASIANU : localize('Asian Up'),
9293
ASIAND : localize('Asian Down'),
93-
CALL : localize('Higher'),
94-
CALLE : localize('Higher or equal'),
95-
PUT : localize('Lower'),
96-
PUTE : localize('Lower or equal'),
94+
CALL : form_name === 'risefall' ? localize('Rise') : localize('Higher'),
95+
CALLE : localize('Rise or equal'),
96+
PUT : form_name === 'risefall' ? localize('Fall') : localize('Lower'),
97+
PUTE : localize('Fall or equal'),
9798
DIGITMATCH : localize('Digit Matches'),
9899
DIGITDIFF : localize('Digit Differs'),
99100
DIGITODD : localize('Digit Odd'),
@@ -120,24 +121,15 @@ const ViewPopup = (() => {
120121
RUNLOW : localize('Only Downs'),
121122
MULTUP : localize('Multiplier Up'),
122123
MULTDOWN : localize('Multiplier Down'),
123-
});
124-
125-
return {
126-
get: () => {
127-
if (!contract_type_display) {
128-
contract_type_display = initContractTypeDisplay();
129-
}
130-
return contract_type_display;
131-
},
132124
};
133-
})();
125+
};
134126

135127
const showContract = () => {
136128
if (!$container) {
137129
$container = makeTemplate();
138130
}
139131

140-
containerSetText('trade_details_contract_type', ContractTypeDisplay.get()[contract.contract_type]);
132+
containerSetText('trade_details_contract_type', ContractTypeDisplay()[contract.contract_type]);
141133
containerSetText('trade_details_purchase_price', formatMoney(contract.currency, contract.buy_price));
142134
containerSetText('trade_details_multiplier', formatMoney(contract.currency, multiplier, false, 3, 2));
143135
if (Lookback.isLookback(contract.contract_type)) {

src/templates/app/trade/explanation.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ const Explanation = () => (
5959

6060
<div id='winning_risefall' className='invisible'>
6161
<h3>{it.L('Winning the contract')}</h3>
62-
<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>
63-
<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>
64-
<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>
62+
<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>
63+
<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>
64+
<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>
6565
</div>
6666

6767
<div id='winning_runbet-lucky10' className='invisible'>

0 commit comments

Comments
 (0)