Synchronize folders of primary account

This commit is contained in:
M66B 2020-12-13 09:49:15 +01:00
parent 6d3ba7213e
commit c3933afd94
1 changed files with 8 additions and 0 deletions

View File

@ -346,6 +346,7 @@ public class FragmentFolders extends FragmentBase {
private void onSwipeRefresh() {
Bundle args = new Bundle();
args.putLong("account", account);
args.putBoolean("primary", primary);
new SimpleTask<Void>() {
@Override
@ -356,6 +357,7 @@ public class FragmentFolders extends FragmentBase {
@Override
protected Void onExecute(Context context, Bundle args) {
long aid = args.getLong("account");
boolean primary = args.getBoolean("primary");
if (!ConnectionHelper.getNetworkState(context).isSuitable())
throw new IllegalStateException(context.getString(R.string.title_no_internet));
@ -372,6 +374,12 @@ public class FragmentFolders extends FragmentBase {
try {
db.beginTransaction();
if (primary) {
EntityAccount account = db.account().getPrimaryAccount();
if (account != null)
aid = account.id;
}
List<EntityFolder> folders;
if (aid < 0)
folders = db.folder().getFoldersUnified(null, true);