From 98e56bab80408f9bad5b1bf2322c9d3b5fafac81 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 27 Feb 2024 10:23:56 +0100 Subject: [PATCH] :bug: Add timeout to request on idle timers --- frontend/src/app/util/timers.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/util/timers.cljs b/frontend/src/app/util/timers.cljs index f3e4bd436b..6df8e2c3a8 100644 --- a/frontend/src/app/util/timers.cljs +++ b/frontend/src/app/util/timers.cljs @@ -43,7 +43,7 @@ (if (and (exists? js/window) (.-requestIdleCallback js/window)) (do - (def ^:private request-idle-callback #(js/requestIdleCallback %)) + (def ^:private request-idle-callback #(js/requestIdleCallback % #js {:timeout 30000})) ;; 30s timeout (def ^:private cancel-idle-callback #(js/cancelIdleCallback %))) (do (def ^:private request-idle-callback #(js/setTimeout % 250))