don't close sheet after logging out

This commit is contained in:
sk 2023-06-02 01:45:30 +02:00
parent 6fdb81a01f
commit d37e880993
1 changed files with 6 additions and 2 deletions

View File

@ -63,6 +63,7 @@ public class AccountSwitcherSheet extends BottomSheet{
private UsableRecyclerView list;
private List<WrappedAccount> accounts;
private ListImageLoaderWrapper imgLoader;
private AccountsAdapter accountsAdapter;
public AccountSwitcherSheet(@NonNull Activity activity, @Nullable HomeFragment fragment){
this(activity, fragment, false, false, null);
@ -101,7 +102,7 @@ public class AccountSwitcherSheet extends BottomSheet{
setOnDismissListener((d) -> activity.finish());
}
adapter.addAdapter(new AccountsAdapter());
adapter.addAdapter(accountsAdapter = new AccountsAdapter());
if (!externalShare) {
adapter.addAdapter(new ClickableSingleViewRecyclerAdapter(makeSimpleListItem(R.string.add_account, R.drawable.ic_fluent_add_24_regular), () -> {
@ -201,7 +202,10 @@ public class AccountSwitcherSheet extends BottomSheet{
activity.finish();
activity.startActivity(new Intent(activity, MainActivity.class));
} else {
dismiss();
accounts.stream().filter(w -> accountID.equals(w.session.getID())).findAny().ifPresent(w -> {
accountsAdapter.notifyItemRemoved(accounts.indexOf(w));
accounts.remove(w);
});
}
}