Skip to content

Commit

Permalink
fix: store render issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuran-deriv committed Nov 20, 2024
1 parent 792e238 commit bb8eb60
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/components/trading-assesment-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,26 @@ const TradingAssesmentModal: React.FC = observer(() => {
const store = useStore();
const { client, ui } = store;

const {
landing_company_shortcode: active_account_landing_company,
is_trading_experience_incomplete,
content_flag,
is_logged_in,
} = client;
const { is_trading_experience_incomplete, content_flag, is_logged_in, accounts, loginid } = client;

const { is_trading_assessment_for_new_user_enabled } = ui;

const should_show_trading_assessment_existing_user_form = useMemo(() => {
return (
is_logged_in &&
active_account_landing_company === 'maltainvest' &&
accounts?.[loginid]?.landing_company_name === 'maltainvest' &&
!is_trading_assessment_for_new_user_enabled &&
is_trading_experience_incomplete &&
content_flag !== ContentFlag.LOW_RISK_CR_EU &&
content_flag !== ContentFlag.LOW_RISK_CR_NON_EU
);
}, [
is_logged_in,
active_account_landing_company,
is_trading_assessment_for_new_user_enabled,
is_trading_experience_incomplete,
content_flag,
accounts,
loginid,
]);
return (
<Modal
Expand Down

0 comments on commit bb8eb60

Please sign in to comment.