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:
committed by
GitHub
parent
58e1503e61
commit
b57e79f8c6
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user