Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

isTransitioning stays true when using --prod

$
0
0

@suyin wrote:

I did encounter a very strange problem.
When using --prod flag navController.isTransitioning() stays true forever, so that I am unable to use pop().
When compiling without the --prod flag everything is fine.

Is it a known issue?
Any workarounds?

My intention is to remove pages and go back to the previous page. I am using animations for transitions.

I am using ionic-angular 3.8.0, cordova 8.0.0

My code:

    public popAndBack(): void {

        const previousPage = this.nav.getPrevious(this.nav.last());

        this.log.debug(this, "this.nav.isTransitioning() = ", this.nav.isTransitioning());
        this.log.debug(this, "this.nav.canGoBack() = ", this.nav.canGoBack());

        if (this.nav.canGoBack() && !this.nav.isTransitioning()) {
            this.nav.pop();
        }
    }

    public push(targetEnum: NavTargetEnum): void {
        if (!this.nullChecker(targetEnum)) {
            return;
        }
        this.nav.push(
            this.mapTargetNameToComponent(targetEnum),
            {navTarget: targetEnum},
            this.getAnimationParams(targetEnum)
        );
    }

    protected getAnimationParams(navTarget: NavTargetEnum): any {

        if (navTarget === NavTargetEnum.GOALS) {
            return {
                animation: this.transitionType,
                animate: true,
                duration: 200,
                easing: "ease-in-out",
                direction: "right"
            };
        }
        else {
            return {
                animation: this.transitionType,
                animate: true,
                duration: 400,
                easing: "ease-in-out",
                direction: "left"
            };
        }
    }

Thank you!

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>