Skip to content

Commit

Permalink
🚸 Use setInterval to check if the DOM is fully loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Jul 18, 2024
1 parent fe964a6 commit db92c84
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,13 @@ export class LikeCoinWalletConnector {
<IntlProvider language={language}>
<AuthcoreDialog
onMount={({ containerId }) => {
setTimeout(() => {
initAuthcore(this.options, { containerId, initialScreen });
}, 100);
const intervalId = setInterval(() => {
const containerElement = document.getElementById(containerId);
if (containerElement) {
initAuthcore(this.options, { containerId, initialScreen });
clearInterval(intervalId);
}
}, 200);
}}
onClose={() => {
this.closeDialog();
Expand Down

0 comments on commit db92c84

Please sign in to comment.