Tabs do not disappear when using setRoot

Hello Hello,

I have a question for you :slight_smile:
So basically I understood how to hide the tabs on subpages when I am using push and everything is working fine.

I implemented a logout service to clean my pouchDB, disconnect from my server etc etc. When everything is ok I am supposed to redirect to the connection page.

However when I am trying to use the setRoot on my navcontroller I can see that the tabs still appears.

When I relaunch my app I am well redirected to the connection page as my credential are no more stored locally and the tabs bar do not appears.

The problem is only when I am deconnecting. And when I am reconnecting I have two tabs (one on the other) which is pretty uggly :smiley:
To finish when I click on the tab from connection page I can display my tabs content but I am getting erros because I cannot reach my server as I am no more connected. However when I connect if I click on this tabs it disappear.

image

Is there a way to remove this tabs??

Thanks a lot Ionic friends

Best regards

Geoffrey

@speedflyer Unfortunately (I think) the NavController setRoot method will set the page under the innermost ion-nav (expected) or ion-tab (unexpected IMO). To handle that I created a service where I set the NavController related to my ion-nav and use push, pop and setRoot in it. Something similar to what I exposed in this post:

Thanks a lot I will try :slight_smile: and I will let you know

Funny, we had that issue too last week.

You will find your solution in following post, you have to set root to the root of the navigation

7 Likes

Thanks a lot. it is working!!!

Like we say in french:

Et pour reedrichard hip hip hip!!!
HOURRAAAA!

:wink:

I think Ionic team should maybe put this in the global spec :slight_smile:

In any case thanks!

Pas de problème, content d’avoir pu t’aider :wink:

i solved this problem use follow code:
constructor(private app: App) {}
logout(){
this.app.getRootNav().setRoot(Login);
}

12 Likes

Thx!! It’s works!! I’m using with 2 tabs in a same app.

thx, work :slight_smile:

Try do add this directive to the button or nav you are click

menuClose

Example

<button menuClose>My Profile</button>

works, but only in dev mode (ios). prod… doesnt do any!