Skip to content

Commit

Permalink
fix: call success modal instead of logging out
Browse files Browse the repository at this point in the history
  • Loading branch information
shontzu-deriv committed Apr 26, 2023
1 parent 3e7ee6c commit 750c147
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/cfd/src/Stores/Modules/CFD/cfd-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export default class CFDStore extends BaseStore {
this.setCFDSuccessDialog(true);
const trading_platform_accounts_list_response = await WS.tradingPlatformAccountsList(values.platform);
this.root_store.client.responseTradingPlatformAccountsList(trading_platform_accounts_list_response);
this.setCFDNewAccount(response.trading_platform_new_account);
} else {
this.setError(true, response.error);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,8 @@ export default class ClientStore extends BaseStore {
WS.tradingPlatformAccountsList(CFD_PLATFORMS.DERIVEZ).then(this.responseTradingPlatformAccountsList);
WS.tradingPlatformAccountsList(CFD_PLATFORMS.DERIVEZ).then(this.responseDerivezAvailableAccounts);

WS.tradingServers(CFD_PLATFORMS.DXTRADE).then(this.responseDxtradeTradingServers);

this.responseStatement(
await BinarySocket.send({
statement: 1,
Expand Down
13 changes: 7 additions & 6 deletions packages/core/src/Stores/traders-hub-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,13 @@ export default class TradersHubStore extends BaseStore {

const { openAccountNeededModal } = ui;
const { is_eu } = client;

if (is_eu && !has_maltainvest_account && standpoint?.iom) {
openAccountNeededModal('maltainvest', localize('Deriv Multipliers'), localize('demo CFDs'));
return;
}
if (platform === CFD_PLATFORMS.DERIVEZ) {
createCFDAccount({ ...account_type, platform });
} else {

} else if (platform !== CFD_PLATFORMS.DERIVEZ) {
enableCFDPasswordModal();
} else {
createCFDAccount({ ...account_type, platform });
}
}
Expand All @@ -543,11 +542,13 @@ export default class TradersHubStore extends BaseStore {
const { client, modules } = this.root_store;
const { has_active_real_account } = client;
const { createCFDAccount, enableCFDPasswordModal, toggleJurisdictionModal } = modules.cfd;

if (has_active_real_account && platform === CFD_PLATFORMS.MT5) {
toggleJurisdictionModal();
} else if (platform !== CFD_PLATFORMS.DERIVEZ) {
enableCFDPasswordModal();
} else {
createCFDAccount({ ...account_type, platform });
enableCFDPasswordModal();
}
}

Expand Down

0 comments on commit 750c147

Please sign in to comment.