Sync folders on swipe refresh folder list

pull/172/head
M66B 5 years ago
parent ebbaa2f100
commit c1c76a3469

@ -335,9 +335,12 @@ public class FragmentFolders extends FragmentBase {
try {
db.beginTransaction();
if (aid < 0) {
// Unified inbox
List<EntityFolder> folders = db.folder().getFoldersUnified(null, true);
List<EntityFolder> folders;
if (aid < 0)
folders = db.folder().getFoldersUnified(null, true);
else
folders = db.folder().getSynchronizingFolders(aid);
for (EntityFolder folder : folders) {
EntityOperation.sync(context, folder.id, true);
@ -349,17 +352,13 @@ public class FragmentFolders extends FragmentBase {
now = false;
}
}
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
if (aid < 0)
ServiceSynchronize.eval(context, "refresh/folders");
else
ServiceSynchronize.reload(context, aid, "refresh/folders");
if (outbox)
ServiceSend.start(context);

Loading…
Cancel
Save