Skip to content

Commit

Permalink
Merge pull request binary-com#155 from jim-deriv/Jim/86519/hide-regio…
Browse files Browse the repository at this point in the history
…n-for-new-accounts

Jim/86519/hide region for new accounts
  • Loading branch information
matin-deriv committed Jan 20, 2023
2 parents c94d4c2 + e05963c commit 0dca817
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions packages/core/src/Stores/traders-hub-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,22 @@ export default class TradersHubStore extends BaseStore {
}
return '';
};

hasMultipleSVGAccounts = () => {
const all_svg_acc = [];
this.combined_cfd_mt5_accounts.map(acc => {
if (acc.landing_company_short === 'svg' && acc.market_type === 'synthetic') {
if (all_svg_acc.length) {
all_svg_acc.forEach(svg_acc => {
if (svg_acc.server !== acc.server) all_svg_acc.push(acc);
return all_svg_acc;
});
} else {
all_svg_acc.push(acc);
}
}
});
return all_svg_acc.length > 1;
};
getShortCodeAndRegion(account) {
let short_code_and_region;
if (this.is_real && !this.is_eu_user) {
Expand All @@ -587,11 +602,13 @@ export default class TradersHubStore extends BaseStore {
? account.landing_company_short?.charAt(0).toUpperCase() + account.landing_company_short?.slice(1)
: account.landing_company_short?.toUpperCase();

const region =
account.market_type !== 'financial' && account.landing_company_short !== 'bvi'
? ` - ${this.getServerName(account)}`
: '';

let region = '';
if (this.hasMultipleSVGAccounts()) {
region =
account.market_type !== 'financial' && account.landing_company_short !== 'bvi'
? ` - ${this.getServerName(account)}`
: '';
}
short_code_and_region = `${short_code}${region}`;
}
return short_code_and_region;
Expand Down

0 comments on commit 0dca817

Please sign in to comment.