1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-10 23:22:22 +02:00

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

This commit is contained in:
Yamagishi Kazutoshi
2025-02-25 07:37:58 +09:00
committed by GitHub
parent edbcf17e3a
commit 4be2351d21

View File

@@ -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) {