Skip to content

Commit

Permalink
Suisin/84164/wrong fe request format (binary-com#7227)
Browse files Browse the repository at this point in the history
* fix: sending wrong request to BE from websocket

* fix: added conditional check on currency before making WS callon traders-hub
  • Loading branch information
suisin-deriv committed Jan 24, 2023
1 parent 7ac8c6f commit 137c3d7
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 137c3d7

Please sign in to comment.