mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 03:19:24 +01:00
@@ -267,6 +267,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
drawerLayout.closeDrawer(drawerContainer);
|
||||
onMenuSetup();
|
||||
}
|
||||
}, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
drawerLayout.closeDrawer(drawerContainer);
|
||||
onReset();
|
||||
}
|
||||
}));
|
||||
|
||||
madapter.set(menus);
|
||||
@@ -985,6 +991,10 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
Helper.view(this, this, getIntentOtherApps());
|
||||
}
|
||||
|
||||
private void onReset() {
|
||||
ServiceSynchronize.reset(this);
|
||||
}
|
||||
|
||||
private void onDebugInfo() {
|
||||
new SimpleTask<Long>() {
|
||||
@Override
|
||||
|
||||
@@ -452,6 +452,8 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||
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();
|
||||
@@ -464,11 +466,8 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
@@ -477,6 +476,9 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
if (!now)
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_connection));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -317,6 +317,8 @@ public class FragmentFolders 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();
|
||||
@@ -329,11 +331,8 @@ public class FragmentFolders 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;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -351,6 +350,9 @@ public class FragmentFolders extends FragmentBase {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
if (!now)
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_connection));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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