Skip to content

Commit

Permalink
Merge pull request #184 from rupato-deriv/Rupato/BOT-2607/Error-not-i…
Browse files Browse the repository at this point in the history
…n-the-current-document

Rupato/BOT-2607/fix: container error not in the document
  • Loading branch information
farabi-deriv authored Dec 11, 2024
2 parents c34230a + 4e61892 commit 02a6ed0
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 02a6ed0

Please sign in to comment.