Fixed timing issues

This commit is contained in:
M66B
2019-12-07 20:32:58 +01:00
parent 7f36e108c6
commit 14628c4d22
16 changed files with 232 additions and 130 deletions

View File

@@ -313,6 +313,7 @@ public class FragmentAccounts extends FragmentBase {
throw new IllegalStateException(context.getString(R.string.title_no_internet));
boolean now = true;
boolean outbox = false;
DB db = DB.getInstance(context);
try {
@@ -323,7 +324,9 @@ public class FragmentAccounts extends FragmentBase {
for (EntityFolder folder : folders) {
EntityOperation.sync(context, folder.id, true);
if (folder.account != null) {
if (folder.account == null)
outbox = true;
else {
EntityAccount account = db.account().getAccount(folder.account);
if (account != null && !"connected".equals(account.state))
now = false;
@@ -335,6 +338,10 @@ public class FragmentAccounts extends FragmentBase {
db.endTransaction();
}
ServiceSynchronize.eval(context, false, "refresh/accounts");
if (outbox)
ServiceSend.start(context);
if (!now)
throw new IllegalArgumentException(context.getString(R.string.title_no_connection));