SetRoot not displaying the Page at times

Hi

Im facing a strange issue in my mobile application while navigating to the Home page after login.
We are using ionic 3 with angular js.
There are some rest services which need to be called on clicking the Login button.
On successful execution of the rest services, i’m navigating to the home page using the following code in a custom provider.

let nav = this.app.getActiveNavs();
nav[0].setRoot(“HomePage”);

Most of the times the navigation happens successfully.
But at times it does not display the home page but continues to stay in the login page.
Methods in the constructor of Home Page are executed successfully but Home page is not displayed.
There is no error in the console tab. Promise returns a true.

Any pointer with regard to this would be of great help.

Regards,
Neethi