File tree 1 file changed +12
-8
lines changed
pyscriptjs/src/components 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -192,14 +192,18 @@ export class BaseEvalElement extends HTMLElement {
192
192
}
193
193
194
194
connectedCallback ( ) {
195
- console . log ( this . name , 'OOOOOOO connected!!!!' )
196
- this . eval ( this . code ) . then ( ( ) => {
197
- this . proxy = this . proxyClass ( this ) ;
198
- console . log ( 'proxy' , this . proxy ) ;
199
- this . proxy . connect ( ) ;
200
- this . registerWidget ( ) ;
201
- } ) ;
202
- console . log ( this . name , 'DOOOOONE connected!!!!' )
195
+ // TODO: we are calling with a 2secs delay to allow pyodide to load
196
+ // ideally we can just wait for it to load and then run. To do
197
+ // so we need to replace using the promise and actually using
198
+ // the interpreter after it loads completely
199
+ setTimeout ( ( ) => {
200
+ this . eval ( this . code ) . then ( ( ) => {
201
+ this . proxy = this . proxyClass ( this ) ;
202
+ console . log ( 'proxy' , this . proxy ) ;
203
+ this . proxy . connect ( ) ;
204
+ this . registerWidget ( ) ;
205
+ } ) ;
206
+ } , 2000 ) ;
203
207
}
204
208
205
209
async registerWidget ( ) {
You can’t perform that action at this time.
0 commit comments