diff --git a/app/src/main/java/com/stevesoltys/seedvault/plugins/webdav/WebDavHandler.kt b/app/src/main/java/com/stevesoltys/seedvault/plugins/webdav/WebDavHandler.kt index d471901a..371cf70b 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/plugins/webdav/WebDavHandler.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/plugins/webdav/WebDavHandler.kt @@ -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. diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageViewModel.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageViewModel.kt index fe5b7a8a..ea3cc3ac 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageViewModel.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageViewModel.kt @@ -99,6 +99,8 @@ internal abstract class StorageViewModel( } } + fun resetWebDavConfig() = webdavHandler.resetConfigState() + @UiThread fun onWebDavConfigSuccess(properties: WebDavProperties, plugin: WebDavStoragePlugin) { mLocationSet.setEvent(true) diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/storage/WebDavConfigFragment.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/storage/WebDavConfigFragment.kt index 90f502df..a302a8d5 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/ui/storage/WebDavConfigFragment.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/ui/storage/WebDavConfigFragment.kt @@ -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 -> {