@@ -17,6 +17,7 @@ package im.vector.app.features.crypto.verification
17
17
18
18
import android.app.Activity
19
19
import android.app.Dialog
20
+ import android.content.DialogInterface
20
21
import android.os.Bundle
21
22
import android.os.Parcelable
22
23
import android.view.KeyEvent
@@ -84,10 +85,6 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetV
84
85
return BottomSheetVerificationBinding .inflate(inflater, container, false )
85
86
}
86
87
87
- init {
88
- isCancelable = false
89
- }
90
-
91
88
override fun onViewCreated (view : View , savedInstanceState : Bundle ? ) {
92
89
super .onViewCreated(view, savedInstanceState)
93
90
@@ -210,6 +207,8 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetV
210
207
return @withState
211
208
}
212
209
210
+ isCancelable = state.isVerificationRequired.not ()
211
+
213
212
// Did the request result in a SAS transaction?
214
213
if (state.sasTransactionState != null ) {
215
214
when (state.sasTransactionState) {
@@ -396,6 +395,11 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetV
396
395
397
396
const val WAITING_SELF_VERIF_TAG : String = " WAITING_SELF_VERIF_TAG"
398
397
}
398
+
399
+ override fun onCancel (dialog : DialogInterface ) {
400
+ super .onCancel(dialog)
401
+ viewModel.confirmCancel()
402
+ }
399
403
}
400
404
401
405
// fun View.getParentCoordinatorLayout(): CoordinatorLayout? {
0 commit comments