Skip to content

Moiz-BOT-2795-Dbot & SmartTrader Should Not Appear in Platform Switcher/TH for EU Accounts #395

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions src/components/layout/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

const { isSingleLoggingIn } = useOauth2();

const { featureFlagValue } = useGrowthbookGetFeatureValue<any>({ featureFlag: 'hub_enabled_country_list' });

Check warning on line 37 in src/components/layout/header/header.tsx

View workflow job for this annotation

GitHub Actions / build_to_cloudflare_pages

Unexpected any. Specify a different type

const renderAccountSection = () => {
if (isAuthorizing || isSingleLoggingIn) {
Expand Down Expand Up @@ -155,6 +155,8 @@
}
};

if (client?.should_hide_header) return null;

return (
<Header
className={clsx('app-header', {
Expand Down
4 changes: 4 additions & 0 deletions src/stores/client-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ export default class ClientStore {
return this.loginid?.startsWith('CR');
}

get should_hide_header() {
return (this.is_eu && this.should_show_eu_error) || (!this.is_logged_in && this.is_eu_country);
}

get account_open_date() {
if (isEmptyObject(this.accounts) || !this.accounts[this.loginid]) return undefined;
return Object.keys(this.accounts[this.loginid]).includes('created_at')
Expand Down
Loading