faster account skip startup

This commit is contained in:
firelight 2023-10-31 00:34:01 +01:00 committed by GitHub
parent 65313b4579
commit 8b73c35e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

View File

@ -22,6 +22,15 @@ class AccountSelectActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val accounts = getAccounts(this@AccountSelectActivity)
// Don't show account selection if there is only
// one account that exists
if (accounts.count() <= 1) {
navigateToMainActivity()
return
}
CommonActivity.init(this)
loadThemes(this)
@ -35,14 +44,6 @@ class AccountSelectActivity : AppCompatActivity() {
val recyclerView: RecyclerView = binding.root.findViewById(R.id.account_recycler_view)
val accounts = getAccounts(this@AccountSelectActivity)
// Don't show account selection if there is only
// one account that exists
if (accounts.count() <= 1) {
navigateToMainActivity()
return
}
val adapter = AccountAdapter(accounts) { selectedAccount ->
// Handle the selected account