Use account rather than currentAccount again

This commit is contained in:
Luna712 2023-11-10 18:11:59 -07:00
parent ae669971c9
commit fd76ce6a59

View file

@ -93,12 +93,8 @@ class AccountViewModel : ViewModel() {
reloadForActivity: Boolean = false
) {
if (reloadForActivity) {
val currentAccount = DataStoreHelper.accounts.firstOrNull {
it.keyIndex == DataStoreHelper.selectedKeyIndex
}
_accounts.postValue(getAccounts(context))
_selectedKeyIndex.postValue(getAccounts(context).indexOf(currentAccount))
_selectedKeyIndex.postValue(getAccounts(context).indexOf(account))
return
}