Skip to content

Commit

Permalink
fix(android): fix sporadic issue with transition cleanup logic called…
Browse files Browse the repository at this point in the history
… twice (#5805)
  • Loading branch information
manoldonev committed May 14, 2018
1 parent 3bb0f4a commit a86d41e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tns-core-modules/ui/frame/fragment.transitions.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,14 @@ function addNativeTransitionListener(entry: ExpandedEntry, nativeTransition: and
function transitionOrAnimationCompleted(entry: ExpandedEntry): void {
const frameId = entry.frameId;
const entries = waitingQueue.get(frameId);
// https://github.com/NativeScript/NativeScript/issues/5759
// https://github.com/NativeScript/NativeScript/issues/5780
// transitionOrAnimationCompleted fires again (probably bug in android)
// NOTE: we cannot reproduce this issue so this is a blind fix
if (!entries) {
return;
}

entries.delete(entry);
if (entries.size === 0) {
const frame = entry.resolvedPage.frame;
Expand All @@ -707,7 +715,7 @@ function transitionOrAnimationCompleted(entry: ExpandedEntry): void {
let current = frame.isCurrent(entry) ? previousCompletedAnimationEntry : entry;
current = current || entry;
// Will be null if Frame is shown modally...
// AnimationCompleted fires again (probably bug in android).
// transitionOrAnimationCompleted fires again (probably bug in android).
if (current) {
const isBack = frame._isBack;
setTimeout(() => frame.setCurrent(current, isBack));
Expand Down

0 comments on commit a86d41e

Please sign in to comment.