Skip to content

Commit

Permalink
fix: error not in the document
Browse files Browse the repository at this point in the history
  • Loading branch information
rupato-deriv committed Dec 11, 2024
1 parent c34230a commit 4e61892
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/stores/load-modal-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,16 +511,17 @@ export default class LoadModalStore {
this.setSelectedStrategyId(workspace_id);

await waitForDomElement('#load-strategy__blockly-container');
const ref_preview = document?.getElementById('load-strategy__blockly-container');

if (!this.recent_workspace) this.recent_workspace = window.Blockly.inject(ref_preview, inject_options);
(this.recent_workspace as any).RTL = isDbotRTL();
const ref_preview = document.getElementById('load-strategy__blockly-container');

const convertedDom = window.Blockly?.utils?.xml?.textToDom(this.selected_strategy?.xml);
const mainWorkspace = window.Blockly?.getMainWorkspace();
if (ref_preview) {
if (!this.recent_workspace) this.recent_workspace = window.Blockly.inject(ref_preview, inject_options);
(this.recent_workspace as any).RTL = isDbotRTL();

window.Blockly?.Xml?.clearWorkspaceAndLoadFromXml(convertedDom, mainWorkspace);
const convertedDom = window.Blockly?.utils?.xml?.textToDom(this.selected_strategy?.xml);
const mainWorkspace = window.Blockly?.getMainWorkspace();

window.Blockly?.Xml?.clearWorkspaceAndLoadFromXml(convertedDom, mainWorkspace);
}
setLoading(false);
this.setOpenButtonDisabled(false);
};
Expand Down

0 comments on commit 4e61892

Please sign in to comment.