Prevent swiping back to previous view

Hello, I want to prevent users from swiping back to the previous view after they sign out.

I am using the index view as the login/signup page. (its not a tab item)
I want to enable users to sign out (via the settings view) and be directed to the index view without being able to swipe left and go back to the previous view (settings view).

has anyone had to work around this?

I was thinking the same. Something like removing a view from the stack history. so it cannot be navigated back to.
I don’t know how possible this is?

2 Likes

Same issue here!
It also create a bug when the user get logged out and is redirected to a login page
→ If the user swipe back the app crash

I don’t know of a way to “remove a view from stack”, but did you set up a page workflow to redirect to index if user is logged out?

Same issue here, When a user logs out I send them back to the login page but then if they swipe back they are redirected to the page they came from

I also saw that if they keep swiping it’s going to take them all the way back to the signup page

I want to stop users from going to the signup login pages when they’re logged in and only give access to signup login pages when the user is not logged in

3 Likes

What I’ve done on this is put login/signup in a sheet, then force that sheet open if they’re logged out. Force it back open if they close it and they’re logged out. Make everything behind it hidden if they’re logged out. On your other views, put an action that will send them to index if they’re logged out which will then force the sheet open. Probably not the best approach but it was the only way I could find to disable the “Swipe” if you’re using index as a login/signup view.

1 Like

I am literally doing that right now. I think it’s the only way around that issue, which is not flawed.

Quick update. We’ve upped the priority of this feature request and are going to tackle it asap. The idea is that there will be a new setting on the Go to view action that allows you to “reset the navigation stack” when navigating to the target view. This will prevent the user from swiping back, because there will be no where to swipe back to! For reference, this is how its done in native mobile development.

8 Likes

Question - would y’all expect to have this be setting on Go to view → Stack, or, a new type of navigation type in the Go to view action (Stack, Modal, Reset Nav Stack)?

1 Like

Could this work?

@nick.carroll I somewhat agree with @cojoeakwetey. Having it here can do 2 things

  1. Allow us navigate to another View while resetting the Nav History
  2. Allow us navigate to the same view while resetting the Nav History (Usually for those occasions where you just need to reset history while remaining on current view)

Just my humble 2cents :blush:

Awesome thanks, will let y’all know when this is live

6 Likes

Hi @nick.carroll , I hope youre doing amazing!

I noticed the reset stack option has been included in the navigation action on mobile.

Thank you!!

However, i tried it and it doesnt work. Is there a particular way to go about it or is the team still working on that.

Thanks again!

yes! Was holding off until the corresponding new version of BubbleGo is out before announcing, but you should be able to test in web preview (ie the auto back button disappears, or the go to previous view action no longer works when reset nav stack is checked)

1 Like

Thank you @nick.carroll!!!

Hi @nick.carroll I noticed a weird behavior on iOS with the reset nav stack action.
If data is being sent to the view with the reset action set, data does not pass on to that view. It seems to be working fine on Android tho.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.