mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Leave CardDAV config fragment when sync is succesful
This commit is contained in:
parent
75ce3a9c05
commit
f6e6914656
2 changed files with 10 additions and 0 deletions
|
|
@ -72,5 +72,12 @@ class CardDavAddressBookConfigurationFragment : GenericMainFragment() {
|
|||
binding.setBackClickListener {
|
||||
goBack()
|
||||
}
|
||||
|
||||
viewModel.syncSuccessfulEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
Log.i("$TAG Sync successful, going back")
|
||||
goBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ class CardDavViewModel : GenericViewModel() {
|
|||
|
||||
val syncInProgress = MutableLiveData<Boolean>()
|
||||
|
||||
val syncSuccessfulEvent = MutableLiveData<Event<Boolean>>()
|
||||
|
||||
private lateinit var friendList: FriendList
|
||||
|
||||
private val friendListListener = object : FriendListListenerStub() {
|
||||
|
|
@ -75,6 +77,7 @@ class CardDavViewModel : GenericViewModel() {
|
|||
)
|
||||
)
|
||||
)
|
||||
syncSuccessfulEvent.postValue(Event(true))
|
||||
}
|
||||
FriendList.SyncStatus.Failure -> {
|
||||
syncInProgress.postValue(false)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue