From f2eb128623c9261d048c28b29bda944faf552a32 Mon Sep 17 00:00:00 2001 From: Thisyahlen Date: Thu, 29 Sep 2022 09:32:28 +0800 Subject: [PATCH 1/4] fix for reset balance --- .../src/App/Containers/AccountSwitcher/account-switcher.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx index 4002bd7d4288..6a51524cf44e 100644 --- a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx +++ b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx @@ -501,7 +501,7 @@ const AccountSwitcher = props => { const canResetBalance = account => { const account_init_balance = 10000; - return account.is_virtual && account.balance < account_init_balance; + return (account.is_virtual && account.balance < account_init_balance) || account.balance > account_init_balance; }; const checkMultipleSvgAcc = () => { From 01be4ff666c8ee75e75d73d2c5d498a4679b0001 Mon Sep 17 00:00:00 2001 From: Thisyahlen Date: Thu, 29 Sep 2022 09:49:55 +0800 Subject: [PATCH 2/4] code refactor --- .../src/App/Containers/AccountSwitcher/account-switcher.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx index 6a51524cf44e..840594effa21 100644 --- a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx +++ b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx @@ -501,7 +501,7 @@ const AccountSwitcher = props => { const canResetBalance = account => { const account_init_balance = 10000; - return (account.is_virtual && account.balance < account_init_balance) || account.balance > account_init_balance; + return account.is_virtual && (account.balance < account_init_balance || account.balance > account_init_balance); }; const checkMultipleSvgAcc = () => { From 481831b3701720db7797e3657b8d9a83a7de8f41 Mon Sep 17 00:00:00 2001 From: Thisyahlen Date: Thu, 29 Sep 2022 10:05:03 +0800 Subject: [PATCH 3/4] code refactor --- .../src/App/Containers/AccountSwitcher/account-switcher.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx index 840594effa21..f410d3460419 100644 --- a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx +++ b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx @@ -501,7 +501,7 @@ const AccountSwitcher = props => { const canResetBalance = account => { const account_init_balance = 10000; - return account.is_virtual && (account.balance < account_init_balance || account.balance > account_init_balance); + return account.is_virtual && account.balance !== account_init_balance; }; const checkMultipleSvgAcc = () => { From ab11a5c30cda4c6ea7dffa3f170ec049a50dfcc3 Mon Sep 17 00:00:00 2001 From: Thisyahlen Date: Thu, 29 Sep 2022 11:07:38 +0800 Subject: [PATCH 4/4] console rates fix --- .../src/Utils/ExchangeCurrencyRate/exchange_currency_rate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/Utils/ExchangeCurrencyRate/exchange_currency_rate.js b/packages/core/src/Utils/ExchangeCurrencyRate/exchange_currency_rate.js index 1fa08688af99..50e78e3b1197 100644 --- a/packages/core/src/Utils/ExchangeCurrencyRate/exchange_currency_rate.js +++ b/packages/core/src/Utils/ExchangeCurrencyRate/exchange_currency_rate.js @@ -3,5 +3,5 @@ import BinarySocket from '_common/base/socket_base'; export const getExchangeRate = async (from_currency, to_currency) => { const { exchange_rates } = await BinarySocket.exchange_rates(from_currency); - return exchange_rates.rates[to_currency]; + return exchange_rates?.rates?.[to_currency]; };