mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-07 15:12:18 +08:00
13 lines
343 B
TypeScript
13 lines
343 B
TypeScript
export function installSyncRafMock() {
|
|
const originalRequestAnimationFrame = window.requestAnimationFrame
|
|
|
|
window.requestAnimationFrame = ((callback: FrameRequestCallback) => {
|
|
callback(0)
|
|
return 0
|
|
}) as typeof window.requestAnimationFrame
|
|
|
|
return () => {
|
|
window.requestAnimationFrame = originalRequestAnimationFrame
|
|
}
|
|
}
|