Skip to content

Commit

Permalink
Show window in idle callback
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Jul 21, 2017
1 parent 9cd2123 commit 2fe3d02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ class Window extends EventEmitter {

if (done == null) return

let limit = Date.now() + 2000
let limit = Date.now() + 200
let ti = setInterval(() => {
if (document.styleSheets.length === count || Date.now() > limit) {
clearInterval(ti)
done()
requestIdleCallback(done, { timeout: 100 })
}
}, 10)

Expand Down

0 comments on commit 2fe3d02

Please sign in to comment.