Reset WebDAV config state when the UI is left
This commit is contained in:
parent
f4366d930f
commit
a95ba41196
3 changed files with 11 additions and 0 deletions
|
@ -65,6 +65,10 @@ internal class WebDavHandler(
|
|||
}
|
||||
}
|
||||
|
||||
fun resetConfigState() {
|
||||
_configState.value = WebDavConfigState.Empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches if there's really an app backup available in the given storage location.
|
||||
* Returns true if at least one was found and false otherwise.
|
||||
|
|
|
@ -99,6 +99,8 @@ internal abstract class StorageViewModel(
|
|||
}
|
||||
}
|
||||
|
||||
fun resetWebDavConfig() = webdavHandler.resetConfigState()
|
||||
|
||||
@UiThread
|
||||
fun onWebDavConfigSuccess(properties: WebDavProperties, plugin: WebDavStoragePlugin) {
|
||||
mLocationSet.setEvent(true)
|
||||
|
|
|
@ -93,6 +93,11 @@ class WebDavConfigFragment : Fragment(), View.OnClickListener {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
viewModel.resetWebDavConfig()
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private fun onConfigStateChanged(state: WebDavConfigState) {
|
||||
when (state) {
|
||||
WebDavConfigState.Empty -> {
|
||||
|
|
Loading…
Reference in a new issue