Skip to content

Commit ac5323a

Browse files
authored
Hirad/UPM-1681/Account closure and transfer modal issue (deriv-com#17207)
* chore: fixed the transfer and account closure pop up issues * chore: updated the types
1 parent ebd3000 commit ac5323a

File tree

7 files changed

+13
-3
lines changed

7 files changed

+13
-3
lines changed

packages/account/src/Sections/Security/ClosingAccount/closing-account-pending-conditions/closing-account-pending-balance.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const ClosingAccountPendingBalance = observer(({ platform, account_balance }: TC
6262
platform,
6363
shortcode: is_mt5_platform ? (account.landing_company_short as TShortcode) : undefined,
6464
is_eu: is_eu_user,
65+
product: account.product,
6566
}) ?? ''
6667
}
6768
value={

packages/account/src/Sections/Security/ClosingAccount/closing-account-pending-conditions/closing-account-pending-positions.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const ClosingAccountPendingPositions = observer(
6363
? (account.landing_company_short as TShortcode)
6464
: undefined,
6565
is_eu: is_eu_user,
66+
product: account.product,
6667
}) ?? ''
6768
}
6869
value={

packages/account/src/Types/common.type.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,20 @@ export type TAccounts = {
217217
title?: string;
218218
};
219219

220+
type TProduct = 'financial' | 'synthetic' | 'swap_free' | 'zero_spread' | 'cTrader' | 'derivx';
221+
220222
type TPendingAccountDetails = {
221223
balance?: number;
222224
currency?: string;
223225
display_login?: string;
224226
positions?: number;
225227
withdrawals?: number;
228+
product?: TProduct;
226229
};
227230

228231
export type TDetailsOfDerivAccount = TAccounts & TPendingAccountDetails;
229232
export type TDetailsOfMT5Account = DetailsOfEachMT5Loginid & TPendingAccountDetails;
230-
export type TDetailsOfDerivXAccount = TDetailsOfMT5Account & { account_id?: string };
233+
export type TDetailsOfDerivXAccount = TDetailsOfMT5Account & { account_id?: string; product?: TProduct };
231234
export type TDetailsOfCtraderAccount = DetailsOfEachMT5Loginid & {
232235
display_balance?: string;
233236
platform?: string;

packages/cashier/src/stores/account-transfer-store.ts

+1
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ export default class AccountTransferStore {
402402
platform: account.account_type,
403403
is_eu: this.root_store.client.is_eu,
404404
is_transfer_form: true,
405+
product: account.product,
405406
}) || ''
406407
}`;
407408
const account_text_display = is_cfd

packages/core/src/App/Containers/AccountSwitcher/account-switcher-account-list.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const AccountList = ({
1616
is_disabled,
1717
is_virtual,
1818
is_eu,
19+
product,
1920
loginid,
2021
market_type,
2122
redirectAccount,
@@ -57,6 +58,7 @@ const AccountList = ({
5758
sub_account_type={sub_account_type}
5859
has_error={has_error}
5960
platform={platform}
61+
product={product}
6062
is_dark_mode_on={is_dark_mode_on}
6163
shortcode={shortcode}
6264
should_show_server_name={should_show_server_name}
@@ -132,12 +134,13 @@ const AccountDisplay = ({
132134
sub_account_type,
133135
platform,
134136
server,
137+
product,
135138
is_dark_mode_on,
136139
is_eu,
137140
shortcode,
138141
should_show_server_name,
139142
}) => {
140-
const account_title = getCFDAccountDisplay({ market_type, sub_account_type, platform, is_eu, shortcode });
143+
const account_title = getCFDAccountDisplay({ market_type, sub_account_type, platform, is_eu, shortcode, product });
141144
// TODO: Remove once account with error has market_type and sub_account_type in details response
142145
const getServerName = React.useCallback(account => {
143146
if (account) {

packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ const AccountSwitcher = observer(({ history, is_mobile, is_visible }) => {
240240
is_disabled={account.is_disabled}
241241
is_virtual={account.is_virtual}
242242
loginid={account.loginid}
243+
product={account.product}
243244
redirectAccount={account.is_disabled ? undefined : () => doSwitch(account.loginid)}
244245
onClickResetVirtualBalance={resetBalance}
245246
selected_loginid={account_loginid}

packages/shared/src/utils/cfd/cfd.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const getCFDAccountKey = ({
9999
return 'all_demo';
100100
}
101101
}
102-
if (market_type === 'all') {
102+
if (market_type === 'all' && platform !== CFD_PLATFORMS.MT5) {
103103
switch (platform) {
104104
case CFD_PLATFORMS.CTRADER:
105105
return 'ctrader';

0 commit comments

Comments
 (0)