diff --git a/src/lib/teact/teactn.tsx b/src/lib/teact/teactn.tsx index bf7248231..58cfc5643 100644 --- a/src/lib/teact/teactn.tsx +++ b/src/lib/teact/teactn.tsx @@ -5,7 +5,7 @@ import React, { import { DEBUG, DEBUG_MORE } from '../../config'; import useForceUpdate from '../../hooks/useForceUpdate'; import generateIdFor from '../../util/generateIdFor'; -import { throttleWithRaf } from '../../util/schedulers'; +import { fastRaf, throttleWithTickEnd } from '../../util/schedulers'; import arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual'; import { orderBy } from '../../util/iteratees'; import { @@ -41,11 +41,11 @@ const containers = new Map(); -const runCallbacksThrottled = throttleWithRaf(runCallbacks); +const runCallbacksThrottled = throttleWithTickEnd(runCallbacks); function runCallbacks(forceOnHeavyAnimation = false) { if (!forceOnHeavyAnimation && isHeavyAnimating()) { - runCallbacksThrottled(); + fastRaf(runCallbacksThrottled); return; }