Open kevholder opened 4 years ago
@kevholder Have you found any way?
@kevholder I have a workaround solution (I'm using typescript):
const setTronWebInterval = setInterval(() => {
this.tronWeb = (window as any)?.tronWeb;
if (this.tronWeb) {
clearInterval(setTronWebInterval);
}
}, 500);
setTimeout(() => {
setTronWeb && clearInterval(setTronWebInterval);
}, 5000);
Currently, the extension takes some time to load and set
window.tronWeb
. Is there a recommended pattern to wait for tronWeb to be set?