# Perspective app navigation doesn't load page after a few tries

**URL:** <https://forum.inductiveautomation.com/t/perspective-app-navigation-doesnt-load-page-after-a-few-tries/74588>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 5, 2023, 6:57pm UTC](https://forum.inductiveautomation.com/t/perspective-app-navigation-doesnt-load-page-after-a-few-tries/74588 "2023-06-05T18:57:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ludovic\_Comtois](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Ludovic\_Comtois](https://forum.inductiveautomation.com/u/Ludovic_Comtois)\
**Post date:** [June 5, 2023, 6:57pm UTC](https://forum.inductiveautomation.com/t/perspective-app-navigation-doesnt-load-page-after-a-few-tries/74588/1 "2023-06-05T18:57:09Z")

</div>

I have a project where I navigate between pages using the navigate() function. A button calls this function to open a navigation menu (menu tree), that navigates to other pages.

When I load the project in chrome (using web dev tools to show as a mobile screen), the navigation works fine. The problem is that when loaded in the app on an iPhone, the navigation menu doesn't open after a while. It works at the start, then doesn't anymore.

I believe this is caused by a cached link in the app (since going back by swiping from the edge of the screen seems to solve the issue.

How could I solve this issue?  
Thanks

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [June 5, 2023, 9:21pm UTC](https://forum.inductiveautomation.com/t/perspective-app-navigation-doesnt-load-page-after-a-few-tries/74588/2 "2023-06-05T21:21:50Z")

</div>

Are you using the Menu Tree's built-in navigation capabilities, or are you using `system.perspective.navigate()`? Or do you have a custom `navigate()` function you've written yourself that opens a Popup which contains a Menu Tree?

Please show the code you've written which seems to be encountering an issue. Screenshots can occasionally suffice, but formatted code snippets are preferred.

---

<div class="post-metadata">

**Author:** ![Ludovic\_Comtois](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Ludovic\_Comtois](https://forum.inductiveautomation.com/u/Ludovic_Comtois)\
**Post date:** [June 6, 2023, 12:09pm UTC](https://forum.inductiveautomation.com/t/perspective-app-navigation-doesnt-load-page-after-a-few-tries/74588/3 "2023-06-06T12:09:44Z")

</div>

There isn't a lot of code, I use the system.perspective.navigate() function to go to a page that contains the menu tree when clicking a button. The menu tree works like Ignition intended.

All the pages I need to access have a standard ignition link ( /example ) and work fine on my browser.

The problem is that when I press the button to go to the page with the menu tree, it sometimes stops navigating there (only in the app). It seems to work the first time I want to access the navigation page, but not afterwards. Nothing happens when I click the button at that point.

---

<div class="post-metadata">

**Author:** ![Ludovic\_Comtois](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Ludovic\_Comtois](https://forum.inductiveautomation.com/u/Ludovic_Comtois)\
**Post date:** [June 6, 2023, 1:48pm UTC](https://forum.inductiveautomation.com/t/perspective-app-navigation-doesnt-load-page-after-a-few-tries/74588/4 "2023-06-06T13:48:08Z")

</div>

The code on the button is as follows :

```auto
if self.page.props.path == "/navigation":
	system.perspective.navigateBack()
	
else:
	system.perspective.navigate('/navigation')

```

As stated earlier, it works as intended on a browser, but not in the iPhone app. It seems that is doesn't want to open the navigation page

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [June 6, 2023, 2:31pm UTC](https://forum.inductiveautomation.com/t/perspective-app-navigation-doesnt-load-page-after-a-few-tries/74588/5 "2023-06-06T14:31:54Z")

</div>

I'd suggest putting some logging into the script to see which branch the session is executing in those instances.

```auto
# at the top of the script
system.util.getLogger("NAV_STATE").info(self.page.props.path)

```

Then check your Gateway logs for the `NAV_SATE` logger the next time you encounter the behavior. You might also want to modify the logged message to include the session ID if you have multiple sessions active and navigating.

---

<div class="post-metadata">

**Author:** ![Ludovic\_Comtois](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Ludovic\_Comtois](https://forum.inductiveautomation.com/u/Ludovic_Comtois)\
**Post date:** [June 6, 2023, 2:46pm UTC](https://forum.inductiveautomation.com/t/perspective-app-navigation-doesnt-load-page-after-a-few-tries/74588/6 "2023-06-06T14:46:13Z")

</div>

It seems that spotty internet connection may be at fault! Logs were sent when the button was working, but not when it wasn't. I also started seeing slow connection and data not appearing during that time.

This is probably due to the fact that my computer is connected to a good wi-fi connection, but the cell phone to LTE with a bad connection to service.

Thanks for the help!
