Prevent loop when exiting the attachments preview screen (#5078)
Disable the custom `BackHandler` when the `sendState` is `Done`. Otherwise, it can get into a loop in some cases where `postCancel()` calls the `OnDoneListener`, which triggers an up navigation, which then simulates a back press... and we end up in the custom `BackHandler` again.
This commit is contained in:
parent
040fde7f22
commit
e14ef24927
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ fun AttachmentsPreviewView(
|
|||
state.eventSink(AttachmentsPreviewEvents.CancelAndClearSendState)
|
||||
}
|
||||
|
||||
BackHandler(enabled = state.sendActionState !is SendActionState.Sending.Uploading) {
|
||||
BackHandler(enabled = state.sendActionState !is SendActionState.Sending.Uploading && state.sendActionState !is SendActionState.Done) {
|
||||
postCancel()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue