Is it possible to prevent that any activitiy gets cancelled before the user confirms the cancel?

Hi everyone,

when the user clicks an item in the navigation main menu, a “START_MAIN_ACTIVITY_REQUESTED” action is dispatched. This is followed by a “CANCEL_REQUESTED” action, which cancels all top level activities.

Here is what I try to do:
I have multiple active activities next to each other. One of them has some input fields which the user can edit (this can lead to a dirty state of the activity). The activity can be closed on a button click, in case the activity is dirty a “DirtyHandling.VetoDialog” is displayed. Based on the user’s decision, the activity is cancelled (or not).
But when the activity is “closed” by clicking an item in the navigation bar, the other activities (except the one which is dirty) get cancelled before SET_CANCEL_CONFIRMATION_REQUIRED is triggered. The result is that only the dirty activity is still visible, the others get cancelled before the user can decide whether he wants to save the entered information or not.

This is the order of actions:

  • ACTION: Application/START_MAIN_ACTIVITY_REQUESTED (click on an item in the navigation main menu)
  • ACTION: Activity/CANCEL_REQUESTED
  • ACTION: Activity/SET_CANCEL_CONFIRMATION_REQUIRED

So my question is:
Is it possible to wait for the user’s confirmation before any activity is cancelled?

Thank you!

I’ve been trying to reproduce this case on my local machine but not successful yet. I will try more later to see all possibilities.
Please post here if you have any update on this :slight_smile:

In order to change this behavior you have two options:

  • Couple your activities together to only have a single top-level activity. This will then result in the desired behavior.
  • Create your own dirty-handling application-saga that overwrites the default behavior. (See [documentation]<INTERNAL_LINK> for more details)