3486: Re-introduce separate check method to not need a synthetic accessor (lint error)
This commit is contained in:
parent
ba50ff5686
commit
3a40274003
|
@ -214,18 +214,21 @@ class EditProfileActivity : BaseActivity(), Injectable {
|
|||
}
|
||||
|
||||
val onBackCallback = object : OnBackPressedCallback(enabled = true) {
|
||||
override fun handleOnBackPressed() {
|
||||
if (viewModel.hasUnsavedChanges(currentProfileData)) {
|
||||
showUnsavedChangesDialog()
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
override fun handleOnBackPressed() = checkForUnsavedChanges()
|
||||
}
|
||||
|
||||
onBackPressedDispatcher.addCallback(this, onBackCallback)
|
||||
}
|
||||
|
||||
fun checkForUnsavedChanges() {
|
||||
if (viewModel.hasUnsavedChanges(currentProfileData)) {
|
||||
showUnsavedChangesDialog()
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
if (!isFinishing) {
|
||||
|
|
Loading…
Reference in New Issue