mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-27 04:45:08 +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;
|
||||
if (animationLevel > 0) {
|
||||
dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();
|
||||
}
|
||||
const dispatchHeavyAnimationStop = dispatchHeavyAnimationEvent();
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
container.classList.add('animating');
|
||||
@ -169,9 +166,7 @@ const Transition: FC<OwnProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
if (dispatchHeavyAnimationStop) {
|
||||
dispatchHeavyAnimationStop();
|
||||
}
|
||||
dispatchHeavyAnimationStop();
|
||||
|
||||
cleanup();
|
||||
|
||||
@ -189,7 +184,7 @@ const Transition: FC<OwnProps> = ({
|
||||
|
||||
currentKeyRef.current = activeKey;
|
||||
|
||||
if (animationLevel > 0 && watchedNode) {
|
||||
if (watchedNode) {
|
||||
waitForAnimationEnd(watchedNode, onAnimationEnd);
|
||||
} else {
|
||||
onAnimationEnd();
|
||||
|
Loading…
Reference in New Issue
Block a user