Workarounds for "back" button

Hi everyone,

Here is a couple of videos showing one of the workarounds how to handle “back” button actions by a user and keep the data consistent. In brief - conditional visibility is your friend.

Best,
Victor.

2 Likes

the second video is private can you check pls

anf the first one was helpful thanks

The second one is set to appear later - seems that YouTube hides it in this case. Will update the link later :wink:

ok thanks

Hi @Victor ,

Im having some issues with the back button at the moment. I have watched your videos and still cannot find a way to get this done. I have messaging in my app and currently I use a redirect screen to determine whether to send a user to an existing conversation or create a new one if one doesnt exist.

When I go to the messaging screen and then press the back arrow it sends me back to the loading screen and I get stuck there. I have tried to impliment a true or false property which for conversation loading and have tried to set it to either on screen load or a countdown.

Countdown: Action fires after the screen has changed - user is updated on messaging screen load and then the countdown which is conditional to that update fires after the screen has changed.

On screen load: Like in the video, if I go back to different screens in my app and then click the back arrow until i reach the loading screen I get stuck on it.

Any ideas or help would be really appreciated.

Thank you,

Kazik

@Kazik I’m not quite sure how your issue is related to this tutorial.
In both videos I am showing how to prevent a user to execute the same action twice (e.g. pay an invoice which is already paid). Basically I am checking the status of the record and “hiding” it after the status is changed.

In your case as I understand the issue is completely different. You would like the action to be “relaunched” when you go back to the previous screen(s).

The thing is, that when you’re using the action “link back” or browser back button, you are getting back to the previous screen which is not recreated. It is kind of a “cached” screen (from the mobile app perspective, you’re getting to the screen instance has been already created).
So the actions on the screen which have been executed upon its creation (initialization) will not run again. That’s the common issue and expected behaviour for React, Flutter, etc.

A possible workaround could be adding a countdown timer, and hiding / showing it again via conditional visibility. When you hide and show the timer, it will relaunch; and therefore the countdown finish action will be executed again.

Best regards, Victor.