Skip to content

Commit

Permalink
thisyahlen/fix: change algo for realAccountSignup (#8656)
Browse files Browse the repository at this point in the history
* fix: change algo for realAccountSignup

* fix: refactor

* redeploy: vercel
  • Loading branch information
thisyahlen-deriv committed Jun 2, 2023
1 parent a539572 commit 5914b2f
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const AddOptions = observer(() => {
openRealAccountSignup('maltainvest');
}
} else {
openRealAccountSignup();
openRealAccountSignup('svg');
}
}}
is_disabled={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const OptionsAndMultipliersListing = () => {
openRealAccountSignup('maltainvest');
}
} else {
openRealAccountSignup();
openRealAccountSignup('svg');
}
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/cfd/src/Stores/Modules/CFD/cfd-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export default class CFDStore extends BaseStore {

beginRealSignupForMt5() {
sessionStorage.setItem('post_real_account_signup', JSON.stringify(this.account_type));
this.root_store.ui.openRealAccountSignup();
this.root_store.ui.openRealAccountSignup('svg');
}

realCFDSignup(set_password) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const DerivRealAccountRequiredModal = ({
openRealAccountSignup('maltainvest');
} else {
onClose();
openRealAccountSignup();
openRealAccountSignup('svg');
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ const AccountSwitcher = ({
if (real_account_creation_unlock_date) {
closeAccountsDialog();
setShouldShowCooldownModal(true);
} else openRealAccountSignup(account);
} else openRealAccountSignup('svg');
}}
className='acc-switcher__new-account-btn'
secondary
Expand Down Expand Up @@ -390,7 +390,7 @@ const AccountSwitcher = ({
closeAccountsDialog();
setShouldShowCooldownModal(true);
} else {
openRealAccountSignup(account);
openRealAccountSignup('maltainvest');
}
}}
className='acc-switcher__new-account-btn'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const NeedRealAccountForCashierModal = observer(() => {

const createAccount = () => {
toggleNeedRealAccountForCashierModal();
return is_eu_user ? openRealAccountSignup('maltainvest') : openRealAccountSignup();
return is_eu_user ? openRealAccountSignup('maltainvest') : openRealAccountSignup('svg');
};

const switchRegulation = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ReadyToDepositModal = observer(() => {
} else if (is_eu_user) {
return openRealAccountSignup('maltainvest');
}
return openRealAccountSignup();
return openRealAccountSignup('svg');
};

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/App/Containers/Redirect/redirect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const Redirect = ({
WS.wait('get_account_status').then(() => {
if (!currency) return openRealAccountSignup('set_currency');
if (hasAnyRealAccount()) return openRealAccountSignup('manage');
return openRealAccountSignup();
return openRealAccountSignup('svg');
});
const ext_platform_url = url_params.get('ext_platform_url');
if (ext_platform_url) {
Expand Down
12 changes: 7 additions & 5 deletions packages/core/src/Stores/ui-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,13 @@ export default class UIStore extends BaseStore {
this.is_positions_drawer_on = true;
}

openRealAccountSignup(target = this.root_store.client.upgradeable_landing_companies?.[0]) {
this.is_real_acc_signup_on = true;
this.real_account_signup_target = target;
this.is_accounts_switcher_on = false;
localStorage.removeItem('current_question_index');
openRealAccountSignup(target) {
if (target) {
this.is_real_acc_signup_on = true;
this.real_account_signup_target = target;
this.is_accounts_switcher_on = false;
localStorage.removeItem('current_question_index');
}
}

setShouldShowCancel(value) {
Expand Down
4 changes: 3 additions & 1 deletion packages/stores/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@ type TUiStore = {
is_reports_visible: boolean;
is_language_settings_modal_on: boolean;
is_mobile: boolean;
openRealAccountSignup: (
value: 'maltainvest' | 'svg' | 'add_crypto' | 'choose' | 'add_fiat' | 'set_currency' | 'manage'
) => void;
notification_messages_ui: React.FC | null;
openRealAccountSignup: (value?: string) => void;
setCurrentFocus: (value: string) => void;
setDarkMode: (is_dark_mode_on: boolean) => boolean;
setReportsTabIndex: (value: number) => void;
Expand Down

0 comments on commit 5914b2f

Please sign in to comment.