navCtrl.remove duplicates View

Hi all!

I’m currently trying to navigate from a LoginPage (my own) that displays an InAppBrowser back to my NavPage which I generated from the official template. I don’t want the user to be able to go back to the login page, so what I did was use this code to remove the page from the nav stack:

browser.on('loadstart')
    .subscribe(
      ((event) => {
        // do stuff
          browser.close();
          this.navCtrl.push(TabsPage).then(() => {
            const index = this.navCtrl.getActive().index;
            this.navCtrl.remove(0,index);
          });
    }));

It navigates to the TabsPage just fine and displays the Home tab, but it still displays a “Back” button. This back button doesn’t lead to the LoginPage tho, instead it leads to another TabsPage which displays the Home tab again.

I simply don’t want no Back button at all, do you know what I’m doing wrong? I’m using Apple’s iOS 10.2 simulator. Thanks in advance!

btw this problem is still happening.

I changed the code to navCtrl.setRoot but it still gives me a back button with a duplicated TabPage view. Also another weird thing is that the tab icons don’t change colors when tabbing on them. I always have to restart the app after my auth flow which doesn’t really give a good user experience.

Anyone else with a similar problem?

1 Like

I have the same issue. Any solutions?

Instead of pushing the TabsPage, I just do this:

this.navCtrl.setRoot(MyApp);

MyApp is the app.component.ts class for me

1 Like