Skip to content

High performance self-hosted photo and video management solution.

fix(web): use anonymous function in `setTimeout` in ponyfill of `requestIdelCallback` (#16264)

Yamagishi Kazutoshi4be2351d21c4
diff --git a/web/src/lib/utils/idle-callback-support.ts b/web/src/lib/utils/idle-callback-support.ts
index 6e79640f3c..dde595379f 100644
--- a/web/src/lib/utils/idle-callback-support.ts
+++ b/web/src/lib/utils/idle-callback-support.ts
@@ -9,7 +9,9 @@ interface RequestIdleCallbackOptions {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function fake_requestIdleCallback(cb: (deadline: RequestIdleCallback) => any, _?: RequestIdleCallbackOptions) {
const start = Date.now();
- return setTimeout(cb({ didTimeout: false, timeRemaining: () => Math.max(0, 50 - (Date.now() - start)) }), 100);
+ return setTimeout(() => {
+ cb({ didTimeout: false, timeRemaining: () => Math.max(0, 50 - (Date.now() - start)) });
+ }, 100);
}
function fake_cancelIdleCallback(id: number) {