Skip to content

Commit

Permalink
fixed default MT5 tab issue (#4140)
Browse files Browse the repository at this point in the history
Co-authored-by: Matin shafiei <[email protected]>
  • Loading branch information
mahdiaryayi-fs and matin-deriv authored Oct 26, 2021
1 parent 3eccb90 commit 92845a7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/trader/src/Modules/CFD/Containers/cfd-dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ class CFDDashboard extends React.Component {

getIndexToSet = () => {
// TODO: remove this when real accounts are enabled for Deriv X
if (!this.state.is_real_enabled) {
return 1;
}
if (!this.state.is_demo_enabled) {
if (this.state.is_real_enabled) {
return 0;
}
if (this.state.is_demo_enabled) {
return 1;
}

const hash = this.props.location.hash;
if (hash) {
Expand All @@ -135,7 +135,7 @@ class CFDDashboard extends React.Component {
else if (index === 0) updated_state.is_demo_tab = false;

const index_to_set = this.getIndexToSet();
if (this.state.active_index !== index_to_set) {
if (index_to_set && this.state.active_index !== index_to_set) {
updated_state.active_index = index_to_set;
}

Expand Down

0 comments on commit 92845a7

Please sign in to comment.