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

thisyahlen/fix: account switcher for mf #7723

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const AddOrManageAccounts = props => {
show_eu_related_content,
is_low_risk,
is_pre_appstore,
loginid,
} = props;

const initial_active_index =
Expand Down Expand Up @@ -138,9 +139,11 @@ const AddOrManageAccounts = props => {
);
}

const is_mf_active = loginid.startsWith('MF');

return (
<ThemedScrollbars is_bypassed={isMobile()} autohide={false}>
{show_eu_related_content && !(is_low_risk && is_pre_appstore) && has_fiat ? (
{(show_eu_related_content && !(is_low_risk && is_pre_appstore) && has_fiat) || is_mf_active ? (
fiat_section
) : (
<Tabs
Expand Down Expand Up @@ -220,6 +223,7 @@ AddOrManageAccounts.propTypes = {
show_eu_related_content: PropTypes.bool,
is_low_risk: PropTypes.bool,
is_pre_appstore: PropTypes.bool,
loginid: PropTypes.string,
};

export default connect(({ client, modules, ui, traders_hub }) => ({
Expand All @@ -237,4 +241,5 @@ export default connect(({ client, modules, ui, traders_hub }) => ({
show_eu_related_content: traders_hub.show_eu_related_content,
is_low_risk: client.is_low_risk,
is_pre_appstore: client.is_pre_appstore,
loginid: client.loginid,
}))(AddOrManageAccounts);
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const RealAccountSignup = ({
state_index,
state_value,
is_low_risk,
loginid,
}) => {
const [current_action, setCurrentAction] = React.useState(null);
const [is_loading, setIsLoading] = React.useState(false);
Expand Down Expand Up @@ -257,14 +258,17 @@ const RealAccountSignup = ({

const [assessment_decline, setAssessmentDecline] = React.useState(false);

const is_mf_active = loginid.startsWith('MF');

const getModalHeight = () => {
if (getActiveModalIndex() === modal_pages_indices.status_dialog) return 'auto';
if (!currency) return '688px'; // Set currency modal
if (has_real_account && currency) {
if (
show_eu_related_content &&
!(is_pre_appstore && is_low_risk) &&
getActiveModalIndex() === modal_pages_indices.add_or_manage_account
(show_eu_related_content &&
!(is_pre_appstore && is_low_risk) &&
getActiveModalIndex() === modal_pages_indices.add_or_manage_account) ||
is_mf_active
) {
// Manage account
return '420px'; // Since crypto is disabled for EU clients, lower the height of modal
Expand Down Expand Up @@ -662,4 +666,5 @@ export default connect(({ ui, client, common, traders_hub, modules }) => ({
state_value: ui.real_account_signup,
show_eu_related_content: traders_hub.show_eu_related_content,
is_low_risk: client.is_low_risk,
loginid: client.loginid,
thisyahlen-deriv marked this conversation as resolved.
Show resolved Hide resolved
}))(withRouter(RealAccountSignup));
4 changes: 1 addition & 3 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,7 @@ export default class ClientStore extends BaseStore {
['set_currency', 'manage'].includes(this.root_store.ui.real_account_signup_target) &&
this.current_landing_company
) {
return this.is_pre_appstore
? getDefaultAllowedCurrencies()
: this.current_landing_company.legal_allowed_currencies;
return this.current_landing_company.legal_allowed_currencies;
}
const target = this.root_store.ui.real_account_signup_target === 'maltainvest' ? 'financial' : 'gaming';

Expand Down