Fix being stuck when cancel clicked in change password dialog

Due to transparent UnlockVaultActivity wasn't finished
This commit is contained in:
Julian Raufelder 2022-06-04 07:20:30 +02:00
parent a6a3b7b2c6
commit 9e92bc6a16
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
3 changed files with 10 additions and 1 deletions

View File

@ -402,6 +402,10 @@ class UnlockVaultPresenter @Inject constructor(
finishWithResult(null)
}
fun onChangePasswordCanceled() {
finishWithResult(null)
}
private open class PendingUnlock(private val vault: Vault?) : Serializable {
private var unlockToken: UnlockToken? = null

View File

@ -110,6 +110,10 @@ class UnlockVaultActivity : BaseActivity(), //
presenter.onChangePasswordClick(vaultModel, unverifiedVaultConfig, oldPassword, newPassword)
}
override fun onChangePasswordCanceled() {
presenter.onChangePasswordCanceled()
}
override fun onDeleteMissingVaultClicked(vault: Vault) {
presenter.onDeleteMissingVaultClicked(vault)
}

View File

@ -25,6 +25,7 @@ class ChangePasswordDialog : BaseProgressErrorDialog<ChangePasswordDialog.Callba
interface Callback {
fun onChangePasswordClick(vaultModel: VaultModel, unverifiedVaultConfig: UnverifiedVaultConfig?, oldPassword: String, newPassword: String)
fun onChangePasswordCanceled()
}
override fun onStart() {
@ -94,7 +95,7 @@ class ChangePasswordDialog : BaseProgressErrorDialog<ChangePasswordDialog.Callba
return builder //
.setTitle(vaultModel.name) //
.setPositiveButton(getString(R.string.dialog_change_password)) { _: DialogInterface, _: Int -> } //
.setNegativeButton(getString(R.string.dialog_button_cancel)) { _: DialogInterface?, _: Int -> } //
.setNegativeButton(getString(R.string.dialog_button_cancel)) { _: DialogInterface?, _: Int -> callback?.onChangePasswordCanceled() } //
.create()
}