Skip to content

Commit

Permalink
fix: get_more_btn
Browse files Browse the repository at this point in the history
  • Loading branch information
amina-deriv committed Jan 19, 2023
1 parent f3b727f commit 32e7620
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions packages/cfd/src/Stores/Modules/CFD/cfd-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default class CFDStore extends BaseStore {
current_list: computed,
has_created_account_for_selected_jurisdiction: computed,
has_submitted_cfd_personal_details: computed,
is_high_risk_client_for_mt5: computed,
onMount: action.bound,
onUnmount: override,
checkShouldOpenAccount: action.bound,
Expand Down Expand Up @@ -642,4 +643,22 @@ export default class CFDStore extends BaseStore {
toggleCFDVerificationModal() {
this.is_cfd_verification_modal_visible = !this.is_cfd_verification_modal_visible;
}

get is_high_risk_client_for_mt5() {
const { trading_platform_available_accounts } = this.root_store.client;
const financial_available_accounts = trading_platform_available_accounts.filter(
available_account => available_account.market_type === 'financial'
);

const synthetic_available_accounts = trading_platform_available_accounts.filter(
available_account => available_account.market_type === 'gaming'
);

return (
financial_available_accounts.length === 1 &&
financial_available_accounts.every(acc => acc.shortcode === 'svg') &&
synthetic_available_accounts.length === 1 &&
synthetic_available_accounts.every(acc => acc.shortcode === 'svg')
);
}
}
4 changes: 3 additions & 1 deletion packages/core/src/Stores/traders-hub-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,13 +544,15 @@ export default class TradersHubStore extends BaseStore {
const {
client: { isEligibleForMoreRealMt5 },
} = this.root_store;
const { is_high_risk_client_for_mt5 } = this.root_store.modules.cfd;

return (
this.is_real &&
!this.is_eu_user &&
(this.hasCFDAccount(CFD_PLATFORMS.MT5, 'real', 'synthetic') ||
this.hasCFDAccount(CFD_PLATFORMS.MT5, 'real', 'financial')) &&
(isEligibleForMoreRealMt5('synthetic') || isEligibleForMoreRealMt5('financial')) &&
this.content_flag !== ContentFlag.HIGH_RISK_CR
!is_high_risk_client_for_mt5
);
}

Expand Down

0 comments on commit 32e7620

Please sign in to comment.