Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit019b7d1

Browse files
committed
add timer to register generic widgets
1 parentac64b2a commit019b7d1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

‎pyscriptjs/src/components/base.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,18 @@ export class BaseEvalElement extends HTMLElement {
192192
}
193193

194194
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);
203207
}
204208

205209
asyncregisterWidget(){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp