Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Animation finished callback only fires once correctly #714

Open
rubit0 opened this issue Sep 8, 2020 · 0 comments
Open

Animation finished callback only fires once correctly #714

rubit0 opened this issue Sep 8, 2020 · 0 comments

Comments

@rubit0
Copy link

rubit0 commented Sep 8, 2020

The null check will always return the fulfilled original promise from a previous playback and so when an animation is played the next time again, it will immediately trigger the promise.

This is my workaround to "clear" the animation before playing again:

public static FixFinishedCallback(animation: MRE.Animation) {
    const animationToFix = animation as any;
    animationToFix._finished = null;
}

I think to solve the issue, the code in the if branch should only return the original promise as long it has not been resolved/fulfilled.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant