mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 10:01:22 +01:00
Reset pull down to refresh on no connectivity
This commit is contained in:
@@ -251,21 +251,24 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||
args.putLong("account", folder.account == null ? -1 : folder.account);
|
||||
args.putLong("folder", folder.id);
|
||||
|
||||
new SimpleTask<EntityAccount>() {
|
||||
new SimpleTask<Boolean>() {
|
||||
@Override
|
||||
protected EntityAccount onLoad(Context context, Bundle args) {
|
||||
long account = args.getLong("account");
|
||||
long folder = args.getLong("folder");
|
||||
protected Boolean onLoad(Context context, Bundle args) {
|
||||
long aid = args.getLong("account");
|
||||
long fid = args.getLong("folder");
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
EntityOperation.sync(db, folder);
|
||||
EntityOperation.sync(db, fid);
|
||||
|
||||
return (account < 0 ? null : db.account().getAccount(account));
|
||||
if (aid < 0) // outbox
|
||||
return "connected".equals(db.folder().getFolder(fid).state);
|
||||
else
|
||||
return "connected".equals(db.account().getAccount(aid).state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLoaded(Bundle args, EntityAccount account) {
|
||||
if (account != null && !"connected".equals(account.state))
|
||||
protected void onLoaded(Bundle args, Boolean connected) {
|
||||
if (!connected)
|
||||
Snackbar.make(itemView, R.string.title_sync_queued, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user