mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 01:51:24 +01:00
@@ -652,6 +652,8 @@ public class FragmentMessages extends FragmentBase {
|
||||
if (!Helper.getNetworkState(context).isSuitable())
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_internet));
|
||||
|
||||
boolean now = true;
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
try {
|
||||
db.beginTransaction();
|
||||
@@ -670,11 +672,8 @@ public class FragmentMessages extends FragmentBase {
|
||||
|
||||
if (folder.account != null) {
|
||||
EntityAccount account = db.account().getAccount(folder.account);
|
||||
if (account != null && !"connected".equals(account.state)) {
|
||||
ServiceSynchronize.reset(context);
|
||||
// Causes rollback
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_connection));
|
||||
}
|
||||
if (account != null && !"connected".equals(account.state))
|
||||
now = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -683,6 +682,9 @@ public class FragmentMessages extends FragmentBase {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
if (!now)
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_connection));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user