Skip to content

Commit

Permalink
thisyahlen/fix: account switcher for mf (deriv-com#7723)
Browse files Browse the repository at this point in the history
* fix: account switcher for mf

* fix: undefined loginid

* fix: add real account modal height

* chore: removed unused props

* chore: remove unused v2
  • Loading branch information
thisyahlen-deriv authored and sanjam-deriv committed Mar 13, 2023
1 parent 31f48e1 commit 559fbaa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
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 @@ -124,7 +124,6 @@ const RealAccountSignup = ({
should_show_risk_warning_modal,
state_index,
state_value,
is_low_risk,
}) => {
const [current_action, setCurrentAction] = React.useState(null);
const [is_loading, setIsLoading] = React.useState(false);
Expand Down Expand Up @@ -261,11 +260,7 @@ const RealAccountSignup = ({
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
) {
if (show_eu_related_content && getActiveModalIndex() === modal_pages_indices.add_or_manage_account) {
// Manage account
return '420px'; // Since crypto is disabled for EU clients, lower the height of modal
}
Expand All @@ -277,6 +272,7 @@ const RealAccountSignup = ({
return 'auto';
}
}

return '740px'; // Account wizard modal
};

Expand Down Expand Up @@ -661,5 +657,4 @@ export default connect(({ ui, client, common, traders_hub, modules }) => ({
should_show_risk_warning_modal: ui.should_show_risk_warning_modal,
state_value: ui.real_account_signup,
show_eu_related_content: traders_hub.show_eu_related_content,
is_low_risk: client.is_low_risk,
}))(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

0 comments on commit 559fbaa

Please sign in to comment.