diff --git a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx index 5c23c1cf8745..ef46d52fd725 100644 --- a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx +++ b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx @@ -61,6 +61,7 @@ const AccountSwitcher = props => { getExchangeRate(props.accounts[vrtc_loginid].currency, props.obj_total_balance.currency).then(res => setExchangedRate(res) ); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); React.useEffect(() => { @@ -454,6 +455,11 @@ const AccountSwitcher = props => { return props.is_dxtrade_allowed; }; + const canResetBalance = account => { + const account_init_balance = 10000; + return account.is_virtual && account.balance < account_init_balance; + }; + const checkMultipleSvgAcc = () => { const all_svg_acc = []; getRealMT5().map(acc => { @@ -495,7 +501,7 @@ const AccountSwitcher = props => { country_standpoint={props.country_standpoint} display_type={'currency'} has_balance={'balance' in props.accounts[account.loginid]} - has_reset_balance={props.accounts[props.account_loginid].is_virtual} + has_reset_balance={canResetBalance(props.accounts[props.account_loginid])} is_disabled={account.is_disabled} is_virtual={account.is_virtual} loginid={account.loginid}