From 7710b223f034bde472f22085faeeb12c8ea02d82 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 28 Jun 2019 10:39:18 +0200 Subject: [PATCH] Revert "Fixed folder sync state" This reverts commit 227d092c2a0874fbee8a66c097a32c438bb6d0ed. --- .../java/eu/faircode/email/ServiceSynchronize.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 02192dcf7a..56573a9972 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -534,6 +534,12 @@ public class ServiceSynchronize extends LifecycleService { private void stopService() { EntityLog.log(this, "Service stop"); + + DB db = DB.getInstance(this); + List ops = db.operation().getOperations(EntityOperation.SYNC); + for (EntityOperation op : ops) + db.folder().setFolderSyncState(op.folder, null); + stopSelf(); } @@ -1384,8 +1390,10 @@ public class ServiceSynchronize extends LifecycleService { for (EntityAccount account : db.account().getAccounts()) db.account().setAccountState(account.id, null); - for (EntityFolder folder : db.folder().getFolders()) + for (EntityFolder folder : db.folder().getFolders()) { db.folder().setFolderState(folder.id, null); + db.folder().setFolderSyncState(folder.id, null); + } } } catch (Throwable ex) { Log.e(ex);