Skip to content

Commit

Permalink
chore: fix workspace not loading in build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shafin-deriv committed Jun 4, 2024
1 parent 0252ace commit 14e9fdc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/stores/app-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default class AppStore {
disposeSwitchAccountListener: unknown;
disposeLandingCompanyChangeReaction: unknown;
disposeResidenceChangeReaction: unknown;
is_dbot_initialized: boolean;

constructor(root_store: RootStore, core: TStores) {
makeObservable(this, {
Expand All @@ -46,6 +47,7 @@ export default class AppStore {
this.dbot_store = null;
this.api_helpers_store = null;
this.timer = null;
this.is_dbot_initialized = false;
}

getErrorForNonEuClients = () => ({
Expand Down Expand Up @@ -146,6 +148,8 @@ export default class AppStore {

blockly_store.setLoading(true);
await DBot.initWorkspace('/', this.dbot_store, this.api_helpers_store, ui.is_mobile, false);
this.is_dbot_initialized = true;

blockly_store.setContainerSize();
blockly_store.setLoading(false);

Expand Down Expand Up @@ -331,6 +335,10 @@ export default class AppStore {
server_time: this.core.common.server_time,
ws: this.root_store.ws,
};

if (!this.is_dbot_initialized) {
this.onMount();
}
};

onClickOutsideBlockly = (event: Event) => {
Expand Down

0 comments on commit 14e9fdc

Please sign in to comment.