[Perf] useSharedIntersectionObserver: Consider heavy animation (follow-up)
This commit is contained in:
parent
be4c220228
commit
e56461a43c
@ -2,6 +2,7 @@ import { getIsHeavyAnimating, useEffect } from '../lib/teact/teact';
|
|||||||
|
|
||||||
import type { CallbackManager } from '../util/callbacks';
|
import type { CallbackManager } from '../util/callbacks';
|
||||||
|
|
||||||
|
import { requestMeasure } from '../lib/fasterdom/fasterdom';
|
||||||
import { createCallbackManager } from '../util/callbacks';
|
import { createCallbackManager } from '../util/callbacks';
|
||||||
import useLastCallback from './useLastCallback';
|
import useLastCallback from './useLastCallback';
|
||||||
|
|
||||||
@ -41,7 +42,9 @@ export default function useSharedIntersectionObserver(
|
|||||||
if (!getIsHeavyAnimating()) {
|
if (!getIsHeavyAnimating()) {
|
||||||
flush();
|
flush();
|
||||||
} else {
|
} else {
|
||||||
getIsHeavyAnimating.once(flush);
|
getIsHeavyAnimating.once(() => {
|
||||||
|
requestMeasure(flush);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user