mirror of
https://codeberg.org/gitnex/GitNex
synced 2025-02-02 12:27:24 +01:00
Fix accounts displaying (#1064)
Clear the accounts list before adding new ones. Hopefully closes #1058 but I couldn't really test it because I don't have this issue without the patch. Co-authored-by: qwerty287 <ndev@web.de> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1064 Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org> Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
parent
f7897041e4
commit
2a46c68d3d
@ -204,12 +204,11 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
userAccountsApi = BaseApi.getInstance(ctx, UserAccountsApi.class);
|
userAccountsApi = BaseApi.getInstance(ctx, UserAccountsApi.class);
|
||||||
|
|
||||||
RecyclerView navRecyclerViewUserAccounts = hView.findViewById(R.id.userAccounts);
|
RecyclerView navRecyclerViewUserAccounts = hView.findViewById(R.id.userAccounts);
|
||||||
UserAccountsNavAdapter adapterUserAccounts;
|
UserAccountsNavAdapter adapterUserAccounts = new UserAccountsNavAdapter(ctx, userAccountsList, drawer);
|
||||||
|
|
||||||
adapterUserAccounts = new UserAccountsNavAdapter(ctx, userAccountsList, drawer);
|
|
||||||
|
|
||||||
userAccountsApi.getAllAccounts().observe((AppCompatActivity) ctx, userAccounts -> {
|
userAccountsApi.getAllAccounts().observe((AppCompatActivity) ctx, userAccounts -> {
|
||||||
if(userAccounts.size() > 0) {
|
if(userAccounts.size() > 0) {
|
||||||
|
userAccountsList.clear();
|
||||||
userAccountsList.addAll(userAccounts);
|
userAccountsList.addAll(userAccounts);
|
||||||
navRecyclerViewUserAccounts.setAdapter(adapterUserAccounts);
|
navRecyclerViewUserAccounts.setAdapter(adapterUserAccounts);
|
||||||
navRecyclerViewFrame.setVisibility(View.VISIBLE);
|
navRecyclerViewFrame.setVisibility(View.VISIBLE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user