mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:05:28 +00:00
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
040fde7f22
commit
e14ef24927
+1
-1
@@ -66,7 +66,7 @@ fun AttachmentsPreviewView(
|
|||||||
state.eventSink(AttachmentsPreviewEvents.CancelAndClearSendState)
|
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()
|
postCancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user