Files
plane/web/core/lib/polyfills/requestIdleCallback.ts
Prateek Shourya 6942e491d0 [WEB-2542] Fix: display filter and tooltip issues in list layout. (#5696)
* [WEB-2542] fix: list layout issues.
* fix: issue type display filter not working.
* fix: layout shift when hovered on bulkops checkbox.

* fix: build errors.

* fix: lint errors
2024-09-25 17:47:46 +05:30

25 lines
587 B
TypeScript

if (typeof window !== "undefined" && window) {
// Add request callback polyfill to browser incase it does not exist
window.requestIdleCallback =
window.requestIdleCallback ??
function (cb) {
const start = Date.now();
return setTimeout(function () {
cb({
didTimeout: false,
timeRemaining: function () {
return Math.max(0, 50 - (Date.now() - start));
},
});
}, 1);
};
window.cancelIdleCallback =
window.cancelIdleCallback ??
function (id) {
clearTimeout(id);
};
}
export {};