Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:binary-com/deriv-app into niloof…
Browse files Browse the repository at this point in the history
…ar/76877/dropdown-component-ts-migration
  • Loading branch information
Niloofar Sadeghi committed Jan 24, 2023
2 parents c7bf806 + 137c3d7 commit e3d754e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ const TotalAssets = ({ category }: TTotalAssets) => {
currency: string,
setExchangeRate: React.Dispatch<React.SetStateAction<number>>
) => {
getExchangeRate(currency, account_total_balance_currency).then((res: number) => {
setExchangeRate(res);
});
if (currency) {
getExchangeRate(currency, account_total_balance_currency).then((res: number) => {
setExchangeRate(res);
});
}
};
if (category === 'real') {
getCurrentExchangeRate(cfd_real_currency, setExchangedRateCfdReal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ const AccountSwitcher = props => {

React.useEffect(() => {
const getCurrentExchangeRate = (currency, setExchangeRate) => {
props.getExchangeRate(currency, account_total_balance_currency).then(res => {
setExchangeRate(res);
});
if (currency) {
props.getExchangeRate(currency, account_total_balance_currency).then(res => {
setExchangeRate(res);
});
}
};
if (cfd_real_currency !== account_total_balance_currency) {
getCurrentExchangeRate(cfd_real_currency, setExchangedRateCfdReal);
Expand Down

0 comments on commit e3d754e

Please sign in to comment.