Skip to content

Commit

Permalink
chore: remove trading experience incomplete (deriv-com#8005)
Browse files Browse the repository at this point in the history
* chore: remove trading experience incomplete

* fix: remove is cfd score available
  • Loading branch information
aizad-deriv authored Mar 23, 2023
1 parent b4139fc commit 63e8bb5
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 17 deletions.
3 changes: 0 additions & 3 deletions packages/core/src/App/Containers/Modals/app-modals.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ const AppModals = ({
is_trading_assessment_for_new_user_enabled,
fetchFinancialAssessment,
setCFDScore,
setIsCFDScoreAvailable,
content_flag,
active_account_landing_company,
is_deriv_account_needed_modal_visible,
Expand All @@ -91,7 +90,6 @@ const AppModals = ({
if (is_logged_in) {
fetchFinancialAssessment().then(response => {
setCFDScore(response?.cfd_score ?? 0);
setIsCFDScoreAvailable(true);
});
}
}, [is_logged_in]);
Expand Down Expand Up @@ -186,7 +184,6 @@ export default connect(({ client, ui, traders_hub }) => ({
has_maltainvest_account: client.has_maltainvest_account,
fetchFinancialAssessment: client.fetchFinancialAssessment,
setCFDScore: client.setCFDScore,
setIsCFDScoreAvailable: client.setIsCFDScoreAvailable,
setShouldShowVerifiedAccount: ui.setShouldShowVerifiedAccount,
should_show_cooldown_modal: ui.should_show_cooldown_modal,
should_show_assessment_complete_modal: ui.should_show_assessment_complete_modal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { Localize, localize } from '@deriv/translations';

const TradingExperienceModal = ({
cfd_score,
is_cfd_score_available,
is_trading_experience_incomplete,
setShouldShowTradingAssessmentModal,
should_show_trading_assessment_modal,
setShouldShowTradeAssessmentForm,
}) => {
React.useEffect(() => {
setShouldShowTradingAssessmentModal(cfd_score === 0 && is_cfd_score_available);
setShouldShowTradingAssessmentModal(cfd_score === 0);
}, []);

const handleOnSubmit = () => {
Expand Down Expand Up @@ -51,5 +50,4 @@ export default connect(({ client, ui }) => ({
should_show_trading_assessment_modal: ui.should_show_trading_assessment_modal,
setShouldShowTradeAssessmentForm: ui.setShouldShowTradeAssessmentForm,
cfd_score: client.cfd_score,
is_cfd_score_available: client.is_cfd_score_available,
}))(TradingExperienceModal);
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const RealAccountSignup = ({
should_show_risk_warning_modal,
state_index,
state_value,
is_trading_experience_incomplete,
}) => {
const [current_action, setCurrentAction] = React.useState(null);
const [is_loading, setIsLoading] = React.useState(false);
Expand Down Expand Up @@ -336,7 +337,7 @@ const RealAccountSignup = ({

React.useEffect(() => {
setRiskWarningTitle(localize('Risk Tolerance Warning'));
return () => setIsTradingAssessmentForNewUserEnabled(false);
return () => setIsTradingAssessmentForNewUserEnabled(is_trading_experience_incomplete);
}, []);

// setCurrentAction callback useEffect to set error details
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export default class ClientStore extends BaseStore {
is_cfd_poi_completed = false;

cfd_score = 0;
is_cfd_score_available = false;

is_mt5_account_list_updated = false;

Expand Down Expand Up @@ -201,7 +200,6 @@ export default class ClientStore extends BaseStore {
dxtrade_disabled_signup_types: observable,
statement: observable,
cfd_score: observable,
is_cfd_score_available: observable,
obj_total_balance: observable,
verification_code: observable,
new_email: observable,
Expand Down Expand Up @@ -311,7 +309,6 @@ export default class ClientStore extends BaseStore {
setPreferredLanguage: action.bound,
setCookieAccount: action.bound,
setCFDScore: action.bound,
setIsCFDScoreAvailable: action.bound,
setSentVerifyEmailsData: action.bound,
updateSelfExclusion: action.bound,
responsePayoutCurrencies: action.bound,
Expand Down Expand Up @@ -1231,9 +1228,6 @@ export default class ClientStore extends BaseStore {
setCFDScore(score) {
this.cfd_score = score;
}
setIsCFDScoreAvailable(is_set) {
this.is_cfd_score_set = is_set;
}

getSelfExclusion() {
return new Promise(resolve => {
Expand Down
2 changes: 0 additions & 2 deletions packages/stores/src/mockStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ const mock = (): TRootStore => {
current_currency_type: '',
current_fiat_currency: '',
cfd_score: 0,
is_cfd_score_available: false,
setCFDScore: jest.fn(),
setIsCFDScoreAvailable: jest.fn(),
getLimits: jest.fn(),
has_active_real_account: false,
has_logged_out: false,
Expand Down
2 changes: 0 additions & 2 deletions packages/stores/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ type TClientStore = {
balance?: string | number;
can_change_fiat_currency: boolean;
cfd_score: number;
is_cfd_score_available: boolean;
setCFDScore: (score: number) => void;
setIsCFDScoreAvailable: (is_set: boolean) => void;
currency: string;
current_currency_type?: string;
current_fiat_currency?: string;
Expand Down

0 comments on commit 63e8bb5

Please sign in to comment.