mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-27 12:55:11 +01:00
[Refactoring] Transition: Small refactoring
This commit is contained in:
parent
8015a7360e
commit
e281dd93b5
@ -133,10 +133,7 @@ const Transition: FC<OwnProps> = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let dispatchHeavyAnimationStop: NoneToVoidFunction;
|
const dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();
|
||||||
if (animationLevel > 0) {
|
|
||||||
dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();
|
|
||||||
}
|
|
||||||
|
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
container.classList.add('animating');
|
container.classList.add('animating');
|
||||||
@ -169,9 +166,7 @@ const Transition: FC<OwnProps> = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dispatchHeavyAnimationStop) {
|
dispatchHeavyAnimationStop();
|
||||||
dispatchHeavyAnimationStop();
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
@ -189,7 +184,7 @@ const Transition: FC<OwnProps> = ({
|
|||||||
|
|
||||||
currentKeyRef.current = activeKey;
|
currentKeyRef.current = activeKey;
|
||||||
|
|
||||||
if (animationLevel > 0 && watchedNode) {
|
if (watchedNode) {
|
||||||
waitForAnimationEnd(watchedNode, onAnimationEnd);
|
waitForAnimationEnd(watchedNode, onAnimationEnd);
|
||||||
} else {
|
} else {
|
||||||
onAnimationEnd();
|
onAnimationEnd();
|
||||||
|
Loading…
Reference in New Issue
Block a user