tzookb
March 6, 2016, 8:51am
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/
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.
tzookb
March 7, 2016, 9:29pm
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.
Yeah I can’t do much with the compiled code, so I’ll need to see some raw stuff
tzookb
March 9, 2016, 8:08am
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
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?
tzookb
March 9, 2016, 8:42pm
7
Now do the same, but change the:
This.withDelay = false;
In this file:
import {Page, NavParams, NavController, Modal} from 'ionic-framework/ionic';
import {RestModal} from '../../modals/rest-modal/rest-modal';
import {ExerciseModal} from '../../modals/exercise-modal/exercise-modal';
@Page({
templateUrl: 'build/pages/workout-runner/workout-runner.html'
})
export class WorkoutRunnerPage {
nav: NavController
counter: number;
withDelay: boolean;
constructor(nav: NavController, navParams: NavParams) {
console.log('workout runner constructor');
this.nav = nav;
this.counter = 0;
/*
you can change this to false, and see the page after 3 rounds will be this page, if this is
This file has been truncated. show original
This will keep modals open without timeout
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.
tzookb
March 10, 2016, 3:12am
9
Thanks, how would you handle my kind of situation? Or I should changed the whole UX?
Do they need to be modals? Why not just regular pages?
tzookb
March 11, 2016, 8:04am
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?
tzookb
March 27, 2016, 9:24am
12
Hey @mhartington sorry for nagging again, but just wanted hear what you say about my last message.
Thanks!
tzookb
April 4, 2016, 12:46pm
13
well anybody else has an idea?
I changed it to pages instead of modals and still same error…