mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(web): use anonymous function in setTimeout in ponyfill of requestIdelCallback (#16264)
This commit is contained in:
parent
edbcf17e3a
commit
4be2351d21
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue