1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-04-21 15:36:26 +02:00

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

This commit is contained in:
Yamagishi Kazutoshi 2025-02-25 07:37:58 +09:00 committed by GitHub
parent edbcf17e3a
commit 4be2351d21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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