Go back after deleting CardDAV config

This commit is contained in:
Sylvain Berfini 2024-07-10 09:49:19 +02:00
parent d8c406320c
commit 0cfdedc09a
2 changed files with 10 additions and 0 deletions

View file

@ -79,5 +79,12 @@ class CardDavAddressBookConfigurationFragment : GenericMainFragment() {
goBack()
}
}
viewModel.friendListRemovedEvent.observe(viewLifecycleOwner) {
it.consume {
Log.i("$TAG CardDAV account removed, going back")
goBack()
}
}
}
}

View file

@ -54,6 +54,8 @@ class CardDavViewModel : GenericViewModel() {
val syncSuccessfulEvent = MutableLiveData<Event<Boolean>>()
val friendListRemovedEvent = MutableLiveData<Event<Boolean>>()
private lateinit var friendList: FriendList
private val friendListListener = object : FriendListListenerStub() {
@ -148,6 +150,7 @@ class CardDavViewModel : GenericViewModel() {
)
)
)
friendListRemovedEvent.postValue(Event(true))
}
}
}