Ionic page removed automatically when it is to fast


#1

I have a new app that has one page that handles a user workout, it launches 2 different modals one for rest, and one for displaying current exercise.

In general the base page, shouldn’t be viewable it only manages the workout phases, but when I launch modals without interaction it fails.

see no interaction here: (click start workout, and finished it, do it twice and then black screen…)
http://tzookb.github.io/fit-auto/

see with interaction, all is good:
http://tzookb.github.io/fit-with-interaction/


#2

Would you be able to simulate this in a basic demo repo? This could be an issue, but without seeing the code, it’s hard to tell.


#3

Yes of course, as you can see I added links that show the error.
Here is a link to the compiled codes:

I’ll create tomorrow another repo with pre compiled code that does the same.


#4

Yeah I can’t do much with the compiled code, so I’ll need to see some raw stuff


#5

Big thanks @mhartington for your help.

Here is a project that does the same as I tried:

simply clone, npm install, and ionic serve

even though you know that much better than me :innocent:


#6

So I’m looking at the project, I run serve I get the first screen, click the button, go to modal management state, it shows a modal twice, fires an alert, closes the modal and then I’m on the management state. What should I be seeing?


#7

Now do the same, but change the:

This.withDelay = false;

In this file:

This will keep modals open without timeout


#8

Ahh ok, this makes sense. You’re trying to show/hide pages at the same time, not really recommended. At some point the page exist at the same time without the delay, then what gets what done to it? Race condition…

I’d probably look at trying rethink the UI for this.


#9

Thanks, how would you handle my kind of situation? Or I should changed the whole UX?


#10

Do they need to be modals? Why not just regular pages?


#11

The only reason I use modals, is because I have a JavaScript object in the main page that contains an array of the pages to go through one by one.

But even if I use pages, in the same manner of exiting and entering a view with no delay, the would still be the same race condition no?


#12

Hey @mhartington sorry for nagging again, but just wanted hear what you say about my last message.

Thanks!


#13

well anybody else has an idea?

I changed it to pages instead of modals and still same error…