Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hamid/83106/resolve-conflicts-on-develop-branch #7121

Merged
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
12 changes: 8 additions & 4 deletions packages/appstore/src/components/CFDs/cfd-real-accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ const CFDRealAccounts = ({
is_visible: isDerivedVisible(CFD_PLATFORMS.DXTRADE),
disabled: has_cfd_account_error(CFD_PLATFORMS.DXTRADE),
platform: CFD_PLATFORMS.DXTRADE,
type: 'synthetic',
// ToDo: deriv x should have type of all in new API
// type: 'all'
type: 'all',
},
];
const REAL_DXTRADE_URL = 'https://dx.deriv.com';
Expand Down Expand Up @@ -145,13 +143,19 @@ const CFDRealAccounts = ({
if (existing_platform === CFD_PLATFORMS.MT5) {
return key.startsWith(`${existing_platform}.real.${market_type}`);
}
if (existing_platform === CFD_PLATFORMS.DXTRADE && market_type === 'all') {
return key.startsWith(`${existing_platform}.real.${existing_platform}@${market_type}`);
}
return key.startsWith(`${existing_platform}.real.${market_type}@${market_type}`);
})
? Object.keys(current_list)
.filter(key => {
if (existing_platform === CFD_PLATFORMS.MT5) {
return key.startsWith(`${existing_platform}.real.${market_type}`);
}
if (existing_platform === CFD_PLATFORMS.DXTRADE && market_type === 'all') {
return key.startsWith(`${existing_platform}.real.${existing_platform}@${market_type}`);
}
return key.startsWith(`${existing_platform}.real.${market_type}@${market_type}`);
})
.reduce((_acc, cur) => {
Expand All @@ -162,7 +166,7 @@ const CFDRealAccounts = ({
return acc;
};

const numberOfExistingAccounts = (account: TStaticAccountProps, market_type: 'financial' | 'synthetic') => {
const numberOfExistingAccounts = (account: TStaticAccountProps, market_type: 'financial' | 'synthetic' | 'all') => {
return existingRealAccounts(account.platform, account?.type)?.filter(acc => acc.market_type === market_type)
.length;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/cfd/src/Stores/Modules/CFD/Helpers/cfd-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ export const getMtCompanies = (is_eu: boolean) => {
all: {
mt5_account_type: all_config.account_type,
leverage: all_config.leverage,
title: localize('Demo'),
title: localize('Real'),
short_title: all_config.short_title,
},
dxtrade: {
mt5_account_type: all_config.account_type,
leverage: all_config.leverage,
title: localize('Demo'),
title: localize('Real'),
short_title: all_config.short_title,
},
synthetic: {
Expand Down