Fix extensions regression bug (#489)

* add output div visibility rule and make sure CustomWidget is being registered

* add new runAfterRuntimeInitialized method that classes can use to run code only after runtime actually initialized

* replace setTimout with proper event to wait for runtime to be completed

* replace setTimout on pyinpytbox with proper event to wait for runtime to be completed
This commit is contained in:
Fabio Pliger
2022-06-01 22:39:05 +02:00
committed by GitHub
parent d6a88d4c9e
commit f60dd6a788
3 changed files with 16 additions and 4 deletions

View File

@@ -43,10 +43,10 @@ export class PyInputBox extends BaseEvalElement {
// TODO: For now we delay execution to allow pyodide to load but in the future this
// should really wait for it to load..
setTimeout(async () => {
this.runAfterRuntimeInitialized(async () => {
await this.eval(this.code);
await this.eval(registrationCode);
console.log('registered handlers');
}, 4000);
});
}
}