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

Commit 1b33a38

Browse files
Revert "Bala/add derivx to account closure (#6533)" (#6629)
This reverts commit 2170df1.
1 parent 18f75d6 commit 1b33a38

File tree

2 files changed

+11
-38
lines changed

2 files changed

+11
-38
lines changed

src/javascript/app/pages/user/account/settings/account_closure.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,10 @@ const AccountClosure = (() => {
6060
BinarySocket.wait('landing_company').then(() => {
6161
if (!has_virtual_only) {
6262
BinarySocket.send({ statement: 1, limit: 1 });
63-
BinarySocket.wait('landing_company', 'get_account_status', 'statement', 'website_status').then(async () => {
63+
BinarySocket.wait('landing_company', 'get_account_status', 'statement').then(async () => {
6464
const is_eligible = await Metatrader.isEligible();
65-
// TODO: is_dxtrade_allowed should be populated based on `landing_company` response
66-
const is_dxtrade_allowed = Client.get('landing_company_shortcode') === 'svg';
67-
6865
if (is_eligible) {
69-
if (is_dxtrade_allowed) {
70-
applyToAllElements('.cfd-link', (element) => { element.setVisibility(1); });
71-
} else {
72-
applyToAllElements('.metatrader-link', (element) => { element.setVisibility(1); });
73-
}
66+
applyToAllElements('.metatrader-link', (element) => { element.setVisibility(1); });
7467
}
7568
});
7669
}
@@ -179,13 +172,13 @@ const AccountClosure = (() => {
179172
const data = { account_closure: 1, reason: getReason() };
180173
BinarySocket.send(data).then(async (response) => {
181174
if (response.error) {
175+
el_submit_loading.setVisibility(0);
182176
if (response.error.details) {
183177
await showErrorPopUp(response);
184178
el_account_closure_error.setVisibility(1);
185179
} else {
186180
showFormMessage(response.error.message || localize('Sorry, an error occurred while processing your request.'));
187181
}
188-
el_submit_loading.setVisibility(0);
189182
el_step_2_submit.setAttribute('disabled', false);
190183
} else {
191184
Client.sendLogoutRequest(false, Url.urlFor('deactivated-account'));
@@ -195,8 +188,6 @@ const AccountClosure = (() => {
195188

196189
const showErrorPopUp = async (response) => {
197190
const mt5_login_list = (await BinarySocket.wait('mt5_login_list')).mt5_login_list;
198-
const dxtrade_accounts_list = (await BinarySocket.send({ trading_platform_accounts: 1, platform: 'dxtrade' })).trading_platform_accounts;
199-
200191
// clear all previously added details first
201192
const previous_parent = document.getElementsByClassName('account-closure-details');
202193
if (previous_parent) { Array.from(previous_parent).forEach(item => { item.parentNode.removeChild(item); }); }
@@ -228,19 +219,12 @@ const AccountClosure = (() => {
228219
const market_type = mt5_account.market_type === 'synthetic' ? 'gaming' : mt5_account.market_type;
229220
return Client.getMT5AccountDisplays(market_type, mt5_account.sub_account_type).short;
230221
};
231-
const getDxtradeDisplay = (account) => {
232-
const dxtrade_account = (dxtrade_accounts_list.find(acc => acc.account_id === account) || {});
233-
return Client.getMT5AccountDisplays(dxtrade_account.market_type, 'financial').short;
234-
};
235222
if (response.error.details.open_positions) {
236223
Object.keys(response.error.details.open_positions).forEach((account) => {
237224
const txt_positions = `${response.error.details.open_positions[account]} position(s)`;
238225
if (/^MT/.test(account)) {
239226
section_id = 'account_closure_open_mt';
240227
display_name = getMTDisplay(account);
241-
} else if (/^DX/.test(account)) {
242-
section_id = 'account_closure_open_dxtrade';
243-
display_name = getDxtradeDisplay(account);
244228
} else {
245229
section_id = 'account_closure_open';
246230
display_name = Currency.getCurrencyName(Client.get('currency', account));
@@ -254,9 +238,6 @@ const AccountClosure = (() => {
254238
if (/^MT/.test(account)) {
255239
section_id = 'account_closure_balance_mt';
256240
display_name = getMTDisplay(account);
257-
} else if (/^DX/.test(account)) {
258-
section_id = 'account_closure_balance_dxtrade';
259-
display_name = getDxtradeDisplay(account);
260241
} else {
261242
section_id = 'account_closure_balance';
262243
display_name = Currency.getCurrencyName(response.error.details.balance[account].currency);

src/templates/app/user/security/account_closure.jsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ const AccountClosureError = () => (
5151
<div className='gr-padding-20 gr-parent invisible' id='account_closure_balance_mt'>
5252
{it.L('You have funds in these MT5 accounts:')}
5353
</div>
54-
<div className='gr-padding-20 gr-parent invisible' id='account_closure_open_dxtrade'>
55-
{it.L('You have open positions in these Deriv X accounts:')}
56-
</div>
57-
<div className='gr-padding-20 gr-parent invisible' id='account_closure_balance_dxtrade'>
58-
{it.L('You have funds in these Deriv X accounts:')}
59-
</div>
6054
</div>
6155
<div id='account_closure_error_buttons' className='gr-padding-10 gr-child'>
6256
<button className='modal-back back button no-margin'>{it.L('OK')}</button>
@@ -76,22 +70,20 @@ const AccountClosure = () => (
7670

7771
<div id='closure_container' className='account-closure'>
7872
<div id='step_1' className='invisible'>
79-
<h1 id='heading'>{it.L('Deactivate account')}</h1>
80-
<p className='account-closure-subtitle'>{it.L('Before you deactivate your account, you’ll need to:')}</p>
73+
<h1 id='heading'>{it.L('Deactivate Account')}</h1>
74+
<p className='account-closure-subtitle'>{it.L('Before you deactivate your account, you need to do the following:')}</p>
8175

8276
<div className='gr-no-gutter'>
8377
<div id='closing_steps' className='gr-padding-10'>
8478
<div className='gr-padding-10'>
85-
<h3 className='secondary-color'>{it.L('1. Ensure to close all your positions')}</h3>
86-
<p className='no-margin'>{it.L('If you have a Binary real account, go to [_1]Portfolio[_2] to close or sell any open positions.', `<a href="${it.url_for('user/portfoliows')}">`, '</a>')}</p>
87-
<p className='invisible metatrader-link no-margin'>{it.L('If you have a DMT5 real account, log in to close any open positions.')}</p>
88-
<p className='invisible cfd-link no-margin'>{it.L('If you have a DMT5 or Deriv X real account, log in to close any open positions.')}</p>
79+
<h3 className='secondary-color'>{it.L('Close open positions')}</h3>
80+
<p className='no-margin'>{it.L('If you have a Binary real account, go to [_1]Portfolio[_2] to close any open positions.', `<a href="${it.url_for('user/portfoliows')}">`, '</a>')}</p>
81+
<p className='invisible metatrader-link no-margin'>{it.L('If you have a MT5 real account, log into it to close any open positions.')}</p>
8982
</div>
9083
<div className='gr-padding-30'>
91-
<h3 className='secondary-color'>{it.L('2. Withdraw your funds')}</h3>
92-
<p className='no-margin'>{it.L('If you have a Binary real account, go to [_1]Cashier[_2] to withdraw your funds.', `<a href="${it.url_for('cashier')}">`, '</a>')}</p>
93-
<p className='invisible metatrader-link no-margin'>{it.L('If you have a DMT5 real account, go to your [_1]DMT5[_2] dashboard to withdraw your funds.', `<a href="${it.url_for('user/metatrader')}">`, '</a>')}</p>
94-
<p className='invisible cfd-link no-margin'>{it.L('If you have a DMT5 or Deriv X real account, go to your [_1]DMT5[_2] or [_3]Deriv X[_4] dashboard to withdraw your funds.', `<a href="${it.url_for('user/metatrader')}">`, '</a>', '<a href="https://app.deriv.com/derivx">', '</a>')}</p>
84+
<h3 className='secondary-color'>{it.L('Withdraw your funds')}</h3>
85+
<p className='no-margin'>{it.L('If you have a Binary real account, go to [_1]Cashier[_2] to withdraw your funds', `<a href="${it.url_for('cashier')}">`, '</a>')}</p>
86+
<p className='invisible metatrader-link no-margin'>{it.L('If you have a MT5 real account, go to [_1]MT5 dashboard[_2] to withdraw your funds.', `<a href="${it.url_for('user/metatrader')}">`, '</a>')}</p>
9587
</div>
9688
</div>
9789

0 commit comments

Comments
 (0)