Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request deriv-com#526 from henry-deriv/henry/87666/bugfix/…
Browse files Browse the repository at this point in the history
…dsmarttrader-reload-twice-switching-account

henry/87666/bugfix/dsmarttrader-reload-twice-switching-account
  • Loading branch information
matin-deriv authored Mar 29, 2023
2 parents a198746 + 905803c commit 5e9c210
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/javascript/app/base/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ const Page = (() => {
return filtered_account;
};
// reload the page when the client account values(except balance and startsession) is changed on other pages.
if (removedSessionAndBalnce(evt.newValue) !== removedSessionAndBalnce(evt.oldValue)) {
const active_loginid = LocalStore.get('active_loginid');
const new_currency = JSON.parse(evt.newValue)[active_loginid].currency;
const old_currency = JSON.parse(evt.oldValue)[active_loginid].currency;

if (removedSessionAndBalnce(evt.newValue) !== removedSessionAndBalnce(evt.oldValue) &&
old_currency !== new_currency) {
reload();
}
}
Expand Down

0 comments on commit 5e9c210

Please sign in to comment.