Don't use getAccounts() just to count them

This commit is contained in:
Luna712 2023-11-05 12:24:03 -07:00
parent 42a1f272a2
commit 9b3d13a7d0
2 changed files with 1 additions and 4 deletions

View file

@ -17,7 +17,7 @@ import com.lagradost.cloudstream3.ui.AutofitRecyclerView
import com.lagradost.cloudstream3.ui.account.AccountAdapter.Companion.VIEW_TYPE_EDIT_ACCOUNT
import com.lagradost.cloudstream3.ui.account.AccountAdapter.Companion.VIEW_TYPE_SELECT_ACCOUNT
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSettings
import com.lagradost.cloudstream3.utils.DataStoreHelper.getAccounts
import com.lagradost.cloudstream3.utils.DataStoreHelper.accounts
import com.lagradost.cloudstream3.utils.DataStoreHelper.setAccount
import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute
@ -33,8 +33,6 @@ class AccountSelectActivity : AppCompatActivity() {
false
)
val accounts = getAccounts(this@AccountSelectActivity)
val skipStartup = getKey(
getString(R.string.skip_startup_account_select_key),
false

View file

@ -14,7 +14,6 @@ class AccountViewModel : ViewModel() {
private val _accounts: MutableLiveData<List<DataStoreHelper.Account>> = MutableLiveData(
context?.let { getAccounts(it) } ?: DataStoreHelper.accounts.toList()
)
val accounts: LiveData<List<DataStoreHelper.Account>> = _accounts
private val _isEditing = MutableLiveData(false)