mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 05:34:32 -04:00
fix(web): use anonymous function in setTimeout
in ponyfill of requestIdelCallback
(#16264)
This commit is contained in:
parent
edbcf17e3a
commit
4be2351d21
@ -9,7 +9,9 @@ interface RequestIdleCallbackOptions {
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function fake_requestIdleCallback(cb: (deadline: RequestIdleCallback) => any, _?: RequestIdleCallbackOptions) {
|
function fake_requestIdleCallback(cb: (deadline: RequestIdleCallback) => any, _?: RequestIdleCallbackOptions) {
|
||||||
const start = Date.now();
|
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) {
|
function fake_cancelIdleCallback(id: number) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user