Hello,
Context :
It’s a meetup.com-like app, so user can join groups, and groups can contain users.
It uses only hidden/showed groups with a “states” system. No pages (since it’s recommended on the forum for better performance.
When navigating through the app, each time a page is seen, a state “mode” is toggled, depending on the group, it shows or hides.
For the groups “group page” and “user profile” that both show a group or user datas depending on a new state “data” in addition of the state “mode”.
What I want to do :
I’m struggling with the “back” button. I want to create a button that sends back to the previous layer.
What I’ve tried :
- Using only states, so I would create a state “previous_modes”. Each time you go to a new layer, it adds the current state. To go back, simply run through all the previous states.
Issue : The list ignores duplicate, but if a user want to see group page -> then see a user -> and then see a group again… it does’nt work.
- Creating a separate database called “navigation” where new entry is added each time a new layer appears, with fields like the order, the current state, the user associated, the group or user object if it’s a “group page” or a “user profil”.
Then when you click on the back button, it does a “search for” to delete the last entry, and switch the states.
Issue : the performance is crap, if I click too fast to navigate, there is a conflict and the app crashes.
I’m quite desperate to find something, the last resort is to create a separate page for group and user.
Thank you.