Skip to content

Commit

Permalink
Merge pull request #209 from VladimirAlexiev/patch-1
Browse files Browse the repository at this point in the history
`setTimeout` doesn't work, use another timeout function
  • Loading branch information
tulios authored Sep 9, 2022
2 parents fbb8948 + c711d2a commit 538abc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extension/src/json-viewer/load-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ function loadCSS(opts) {
}

if (/loaded/.test(content)) {
clearTimeout(scheduleId);
cancelAnimationFrame(scheduleId);
document.body.removeChild(checkElement);
resolve();

} else {
attempts++;
scheduleId = setTimeout(scheduleCheck, 1);
scheduleId = requestAnimationFrame(scheduleCheck, 1);
}
}

Expand Down

0 comments on commit 538abc7

Please sign in to comment.