mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Fix / prevent cancel when in conclusion fragment
This commit is contained in:
parent
1de57bbf3b
commit
acd90657c7
@ -142,14 +142,19 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(
|
||||
args: VerificationBottomSheet.VerificationArgs): VerificationBottomSheetViewModel
|
||||
}
|
||||
|
||||
fun queryCancel() = withState {
|
||||
if (it.userThinkItsNotHim) {
|
||||
fun queryCancel() = withState { state ->
|
||||
if (state.userThinkItsNotHim) {
|
||||
setState {
|
||||
copy(userThinkItsNotHim = false)
|
||||
}
|
||||
} else {
|
||||
setState {
|
||||
copy(userWantsToCancel = true)
|
||||
// if the verification is already done you can't cancel anymore
|
||||
if (state.pendingRequest.invoke()?.cancelConclusion != null || state.sasTransactionState is VerificationTxState.TerminalTxState) {
|
||||
// you cannot cancel anymore
|
||||
} else {
|
||||
setState {
|
||||
copy(userWantsToCancel = true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user