Skip to content

Commit

Permalink
setTimeout doesn't work, use another timeout function
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirAlexiev authored Jul 21, 2018
1 parent 69d3cdc commit c711d2a
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 c711d2a

Please sign in to comment.