Skip to content

Commit

Permalink
Thisyahlen/87555/switching to mf account upon login if no cr account …
Browse files Browse the repository at this point in the history
…for low risk (binary-com#7519)

* fix: exit traders hub

* fix: When login back to the account with has EU only the data for MF is showing

* fix: exit from non-eu from traders hub, multipliers is still the active account
  • Loading branch information
thisyahlen-deriv authored and sanjam-deriv committed Mar 13, 2023
1 parent 2ac4796 commit c8dc93f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ExitTradersHubModal = ({
const cr_account = active_accounts.some(acc => acc.landing_company_shortcode === 'svg');
toggleExitTradersHubModal();

if (content_flag === ContentFlag.LOW_RISK_CR_EU) {
if (content_flag === ContentFlag.LOW_RISK_CR_EU || content_flag === ContentFlag.LOW_RISK_CR_NON_EU) {
if (!cr_account) {
await switchAccount(account_list.find(acc => acc.loginid.startsWith('VRTC'))?.loginid);
}
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,11 @@ export default class ClientStore extends BaseStore {
if (!this.is_virtual) {
this.setPrevRealAccountLoginid(this.loginid);
}
const no_cr_account = this.active_accounts.some(acc => acc.landing_company_shortcode === 'svg');

if (!no_cr_account && this.is_low_risk) {
this.switchAccount(this.virtual_account_loginid);
}
}

this.selectCurrency('');
Expand Down

0 comments on commit c8dc93f

Please sign in to comment.