I have a tabbed view that has at least two tabs: account and favorites.
The account view has links to the Login page, and the favorites page displays a login form for logged out users that can also log users in. The Login page has a guard,
ionViewCanEnter that returns
false if the user is logged in.
If you navigate to the Login page and then select the Favorites tab, log in, and then select the Accounts tab, the app will crash because the navigation to the Account tab keeps getting rejected because of the guard.
There are two possible solutions that I can see:
- After successful login on the favorites tab, reset the account tab to the Account page instead of the Login page.
- There doesn’t seem to be a way to change the navigation of a different tab from the current tab.
- Catch the navigation error caused by the guard when navigating tabs and set the Account page for the account tab accordingly.
Is there any way to do either of the above?