Set timeout to pop page to root after X seconds


#1

Currently when a user submits a form it shows and thank you overlay - after 2.5 seconds I want the overlay to disappear.

My currently code looks like this.

ionViewWillEnter()
{
    setTimeout(() => {
        this.navCtrl.popToRoot();
    }, 2500);
}

But the page just stays on forever and never pops back to the root page


#2

it is probably relevant how you show the “overlay”.


#3

I use the ModalController and create that page and present it


#4

Isn’t this the entire point of toasts?