mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-29 04:17:12 +01:00
Fix crash in anonymous mode in MainActivity.
This commit is contained in:
parent
79392bbeae
commit
a6f2899b75
@ -31,7 +31,6 @@ import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@ -64,7 +63,6 @@ import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import ml.docilealligator.infinityforreddit.Account.Account;
|
||||
import ml.docilealligator.infinityforreddit.Account.AccountViewModel;
|
||||
import ml.docilealligator.infinityforreddit.ActivityToolbarInterface;
|
||||
import ml.docilealligator.infinityforreddit.Adapter.NavigationDrawerRecyclerViewAdapter;
|
||||
@ -835,9 +833,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
||||
accountViewModel = new ViewModelProvider(this,
|
||||
new AccountViewModel.Factory(getApplication(), mRedditDataRoomDatabase, mAccountName)).get(AccountViewModel.class);
|
||||
accountViewModel.getAccountsExceptCurrentAccountLiveData().observe(this, adapter::changeAccountsDataset);
|
||||
accountViewModel.getCurrentAccountLiveData().observe(this, new Observer<Account>() {
|
||||
@Override
|
||||
public void onChanged(Account account) {
|
||||
accountViewModel.getCurrentAccountLiveData().observe(this, account -> {
|
||||
if (account != null) {
|
||||
adapter.updateKarma(account.getKarma());
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user