File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
explorer-v2/src/lib/scripts Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,24 @@ export async function loadMonacoEditor() {
8484 (editorLoaded = new Promise((resolve) => {
8585 if (typeof window !== 'undefined') {
8686 // eslint-disable-next-line n/no-missing-require -- ignore
87- window.require(['vs/editor/editor.main'], (r ) => {
88- resolve(r );
87+ window.require(['vs/editor/editor.main'], () => {
88+ waitForMonacoReady().then(() => resolve(window.monaco) );
8989 });
9090 }
9191 }))
9292 );
9393}
94+
95+ function waitForMonacoReady() {
96+ return new Promise((resolve) => {
97+ function check() {
98+ if (window.monaco && window.monaco.editor && window.monaco.editor.create) {
99+ resolve();
100+ return;
101+ }
102+ setTimeout(check, 0);
103+ }
104+
105+ check();
106+ });
107+ }
You can’t perform that action at this time.
0 commit comments