diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt index 34a49e852e..d09eafee58 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapConfirmPassphraseFragment.kt @@ -95,6 +95,14 @@ class BootstrapConfirmPassphraseFragment @Inject constructor( sharedViewModel.handle(BootstrapActions.TogglePasswordVisibility) } .disposeOnDestroyView() + + bootstrapSubmit.clicks() + .debounce(300, TimeUnit.MILLISECONDS) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe { + submit() + } + .disposeOnDestroyView() } private fun submit() = withState(sharedViewModel) { state -> @@ -113,8 +121,6 @@ class BootstrapConfirmPassphraseFragment @Inject constructor( } override fun invalidate() = withState(sharedViewModel) { state -> - super.invalidate() - if (state.step is BootstrapStep.ConfirmPassphrase) { val isPasswordVisible = state.step.isPasswordVisible ssss_passphrase_enter_edittext.showPassword(isPasswordVisible, updateCursor = false) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapEnterPassphraseFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapEnterPassphraseFragment.kt index 35e2e1373c..952b0e5d03 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapEnterPassphraseFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/recover/BootstrapEnterPassphraseFragment.kt @@ -90,6 +90,14 @@ class BootstrapEnterPassphraseFragment @Inject constructor( sharedViewModel.handle(BootstrapActions.TogglePasswordVisibility) } .disposeOnDestroyView() + + bootstrapSubmit.clicks() + .debounce(300, TimeUnit.MILLISECONDS) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe { + submit() + } + .disposeOnDestroyView() } private fun submit() = withState(sharedViewModel) { state -> @@ -108,8 +116,6 @@ class BootstrapEnterPassphraseFragment @Inject constructor( } override fun invalidate() = withState(sharedViewModel) { state -> - super.invalidate() - if (state.step is BootstrapStep.SetupPassphrase) { val isPasswordVisible = state.step.isPasswordVisible ssss_passphrase_enter_edittext.showPassword(isPasswordVisible, updateCursor = false) diff --git a/vector/src/main/res/layout/fragment_bootstrap_enter_passphrase.xml b/vector/src/main/res/layout/fragment_bootstrap_enter_passphrase.xml index c4289aa3be..b344f2819d 100644 --- a/vector/src/main/res/layout/fragment_bootstrap_enter_passphrase.xml +++ b/vector/src/main/res/layout/fragment_bootstrap_enter_passphrase.xml @@ -1,5 +1,4 @@ - @@ -78,6 +76,13 @@ app:layout_constraintStart_toEndOf="@+id/ssss_passphrase_enter_til" app:layout_constraintTop_toTopOf="@+id/ssss_passphrase_enter_til" /> +