Skip to content

Commit

Permalink
Merge pull request #14 from cyreb7/fix/request-idle-callback
Browse files Browse the repository at this point in the history
🐛 fix error when `requestIdleCallback` is unsupported
  • Loading branch information
astoilkov authored Mar 20, 2024
2 parents 05b0ddf + a499ff5 commit 3b99485
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ricTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class RicTracker {
}

stop() {
if (!this.available) {
return
}

cancelIdleCallback(this.#idleCallbackId)
this.#idleCallbackId = undefined
}
Expand Down

0 comments on commit 3b99485

Please sign in to comment.