mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Go to assistant when last account has been removed
This commit is contained in:
parent
a676c51401
commit
505fa3b66c
2 changed files with 16 additions and 1 deletions
|
|
@ -220,6 +220,12 @@ class MainActivity : GenericActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
viewModel.lastAccountRemovedEvent.observe(this) {
|
||||
it.consume {
|
||||
startActivity(Intent(this, AssistantActivity::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for latest visited fragment to be displayed before hiding the splashscreen
|
||||
binding.root.viewTreeObserver.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener {
|
||||
override fun onPreDraw(): Boolean {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,11 @@ class MainViewModel @UiThread constructor() : ViewModel() {
|
|||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
var accountsFound = -1
|
||||
val lastAccountRemovedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
private var accountsFound = -1
|
||||
|
||||
var mainIntentHandled = false
|
||||
|
||||
|
|
@ -264,6 +268,11 @@ class MainViewModel @UiThread constructor() : ViewModel() {
|
|||
removeAlert(NON_DEFAULT_ACCOUNT_NOT_CONNECTED)
|
||||
core.refreshRegisters()
|
||||
computeNonDefaultAccountNotificationsCount()
|
||||
|
||||
if (core.accountList.isEmpty()) {
|
||||
Log.w("$TAG No more account configured, going into assistant")
|
||||
lastAccountRemovedEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue