Synchronize folders of primary account

pull/190/head
M66B 4 years ago
parent 6d3ba7213e
commit c3933afd94

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

Loading…
Cancel
Save