Fix / prevent cancel when in conclusion fragment
This commit is contained in:
parent
1de57bbf3b
commit
acd90657c7
@ -142,17 +142,22 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(
|
|||||||
args: VerificationBottomSheet.VerificationArgs): VerificationBottomSheetViewModel
|
args: VerificationBottomSheet.VerificationArgs): VerificationBottomSheetViewModel
|
||||||
}
|
}
|
||||||
|
|
||||||
fun queryCancel() = withState {
|
fun queryCancel() = withState { state ->
|
||||||
if (it.userThinkItsNotHim) {
|
if (state.userThinkItsNotHim) {
|
||||||
setState {
|
setState {
|
||||||
copy(userThinkItsNotHim = false)
|
copy(userThinkItsNotHim = false)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 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 {
|
} else {
|
||||||
setState {
|
setState {
|
||||||
copy(userWantsToCancel = true)
|
copy(userWantsToCancel = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun confirmCancel() = withState { state ->
|
fun confirmCancel() = withState { state ->
|
||||||
cancelAllPendingVerifications(state)
|
cancelAllPendingVerifications(state)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user