Can't get to my Page JS Object and APIs

I can’t get to my Splash screen and its JS Object and APIs. I was working on making a smoother login process for my app. :thinking:

By smoother, I was looking to have the initial page (an empty splash page) check to see if a user was logged in (I use Xano for my backend/APIs)
– if they are logged in they go directly to the main page
– if they are not logged in (invalid or no auth token) they go directly to the login page.

This is where the problem comes in. Since the initial splash screen does the “logged in” check on page load, even when I am in edit on my app the function is called and I am immediately routed, in edit mode, to the login screen.

Since you can only get to the page details by being on the page, I can’t get to the function to turn off the onpage execution. It is looking like my only option is to delete the initial/splash page and start it over.

Any suggestions on how I can handle this situation?

@sstava are you on cloud? You could export your app and manually update the check for the JSObject to avoid this. I suggest adding this check only in view mode using the appsmith.mode parameter

Thanks for the response and the recommendation to use the appsmith.mode parameter!

I was able to wrap my function with an IF using the appsmith.mode parameter to prevent it from executing in EDIT mode.

It would be nice to have a way to disable a page’s function calls/logic so that you could get into a page and its JS Objects and datasources if you did something that prevented it…like I did.

Even if there was just a “Disable Code” menu option in the page’s context menu it would help easily overcome these types of scenarios :thinking:

Thanks for the suggestion! That makes sense we’ll consider this feature