Skip to content

Commit

Permalink
[P2PS] / Ameerul / P2PS-4532 PA client gets logout when login (deriv-…
Browse files Browse the repository at this point in the history
…com#17699)

* fix: added is_authroize check from client store before calling p2p_settings

* fix: set mt5_login_list in WS.authorized
  • Loading branch information
ameerul-deriv authored Dec 5, 2024
1 parent 13cf3a4 commit d744c63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
const {
account_status,
has_wallet,
is_authorize,
is_logged_in,
is_logging_in,
is_virtual,
Expand Down Expand Up @@ -92,10 +93,10 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
const TradersHubIcon = is_dark_mode ? 'IcAppstoreHomeDark' : 'IcAppstoreTradersHubHomeUpdated';

React.useEffect(() => {
if (isSuccess && !isSubscribed) {
if (isSuccess && !isSubscribed && is_authorize) {
subscribe();
}
}, [isSuccess, p2p_settings, subscribe, isSubscribed]);
}, [isSuccess, p2p_settings, subscribe, isSubscribed, is_authorize]);

React.useEffect(() => {
const processRoutes = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ export default class ClientStore extends BaseStore {
if (this.is_logged_in) {
this.getWalletMigrationState();

await WS.mt5LoginList().then(this.responseMt5LoginList);
await WS.authorized.mt5LoginList().then(this.responseMt5LoginList);
WS.tradingServers(CFD_PLATFORMS.MT5).then(this.responseMT5TradingServers);

WS.tradingPlatformAvailableAccounts(CFD_PLATFORMS.MT5).then(this.responseTradingPlatformAvailableAccounts);
Expand Down

0 comments on commit d744c63

Please sign in to comment.