{({ field }) => (
@@ -162,7 +144,6 @@ const Endpoint = () => {
(!touched.server &&
!touched.app_id &&
!touched.is_appstore_enabled &&
- !touched.is_pre_appstore_enabled &&
!touched.show_dbot_dashboard &&
!touched.is_debug_service_worker_enabled) ||
!values.server ||
diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js
index 0f7e3bc88644..8f831f8d4488 100644
--- a/packages/core/src/Stores/client-store.js
+++ b/packages/core/src/Stores/client-store.js
@@ -286,6 +286,7 @@ export default class ClientStore extends BaseStore {
is_eu_country: computed,
is_options_blocked: computed,
is_multipliers_only: computed,
+ is_pre_appstore: computed,
resetLocalStorageValues: action.bound,
getBasicUpgradeInfo: action.bound,
setMT5DisabledSignupTypes: action.bound,
@@ -375,6 +376,7 @@ export default class ClientStore extends BaseStore {
isEuropeCountry: action.bound,
setPrevRealAccountLoginid: action.bound,
switchAccountHandlerForAppstore: action.bound,
+ setIsPreAppStore: action.bound,
});
reaction(
@@ -934,6 +936,11 @@ export default class ClientStore extends BaseStore {
return this.isBotAllowed();
}
+ get is_pre_appstore() {
+ const { trading_hub } = this.account_settings;
+ return !!trading_hub;
+ }
+
getIsMarketTypeMatching = (account, market_type) =>
market_type === 'synthetic'
? account.market_type === market_type || account.market_type === 'gaming'
@@ -2030,7 +2037,7 @@ export default class ClientStore extends BaseStore {
const is_client_logging_in = login_new_user ? login_new_user.token1 : obj_params.token1;
if (is_client_logging_in) {
- const is_pre_appstore = window.localStorage.getItem('is_pre_appstore');
+ const is_pre_appstore = !!this.account_settings.trading_hub;
const redirect_url = sessionStorage.getItem('redirect_url');
if (
is_pre_appstore === 'true' &&
@@ -2507,5 +2514,19 @@ export default class ClientStore extends BaseStore {
await this.switchAccount(this.virtual_account_loginid);
}
}
+
+ setIsPreAppStore(is_pre_appstore) {
+ const trading_hub = is_pre_appstore ? 1 : 0;
+ if (this.is_pre_appstore !== is_pre_appstore) {
+ WS.setSettings({
+ set_settings: 1,
+ trading_hub,
+ }).then(response => {
+ if (!response.error) {
+ this.account_settings = { ...this.account_settings, trading_hub };
+ }
+ });
+ }
+ }
}
/* eslint-enable */