From a499ff5ea967a27244208a1b30fd2e8648e7828f Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 19 Mar 2024 15:27:01 -0700 Subject: [PATCH] Fix error when requestIdleCallback is unsupported --- src/ricTracker.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ricTracker.ts b/src/ricTracker.ts index 569729d..4558a78 100644 --- a/src/ricTracker.ts +++ b/src/ricTracker.ts @@ -49,6 +49,10 @@ class RicTracker { } stop() { + if (!this.available) { + return + } + cancelIdleCallback(this.#idleCallbackId) this.#idleCallbackId = undefined }