mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-24 05:55:39 +03:00
run user repo call in coroutine
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
349d5fe19b
commit
75c8625aee
1 changed files with 13 additions and 5 deletions
|
@ -58,7 +58,6 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ACTIVE_CONVERSATION
|
|||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_USER_ENTITY
|
||||
import com.nextcloud.talk.utils.database.user.UserUtils
|
||||
import io.reactivex.Observer
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
@ -66,6 +65,9 @@ import io.reactivex.schedulers.Schedulers
|
|||
import io.requery.Persistable
|
||||
import io.requery.android.sqlcipher.SqlCipherDatabaseSource
|
||||
import io.requery.reactivex.ReactiveEntityStore
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.parceler.Parcels
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -115,10 +117,16 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||
onNewIntent(intent)
|
||||
} else if (!router!!.hasRootController()) {
|
||||
if (hasDb) {
|
||||
if (usersRepository.getUsers().isNotEmpty()) {
|
||||
setDefaultRootController()
|
||||
} else {
|
||||
launchLoginScreen()
|
||||
GlobalScope.launch {
|
||||
if (usersRepository.getUsers().isNotEmpty()) {
|
||||
runOnUiThread {
|
||||
setDefaultRootController()
|
||||
}
|
||||
} else {
|
||||
runOnUiThread {
|
||||
launchLoginScreen()
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
launchLoginScreen()
|
||||
|
|
Loading…
Reference in a new issue