diff --git a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java index 02f97b5f49..cdcf6d1d32 100644 --- a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java +++ b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java @@ -521,7 +521,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback kv = new HashMap<>(); final private Map> values = new HashMap<>(); @@ -5703,10 +5704,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. } } + Long syncTime = null; + if (viewType == AdapterMessage.ViewType.FOLDER && folders.size() == 1) + syncTime = folders.get(0).last_sync; + if (Objects.equals(lastUnseen, unseen) && Objects.equals(lastRefreshing, refreshing) && Objects.equals(lastFolderErrors, folderErrors) && - Objects.equals(lastAccountErrors, accountErrors)) { + Objects.equals(lastAccountErrors, accountErrors) && + Objects.equals(lastSyncTime, syncTime)) { Log.i("Folder state unchanged"); return; } @@ -5715,6 +5721,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. lastRefreshing = refreshing; lastFolderErrors = folderErrors; lastAccountErrors = accountErrors; + lastSyncTime = syncTime; // Get name String name; @@ -5740,14 +5747,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. name = getString(R.string.title_name_count, name, NF.format(unseen)); setSubtitle(name); - if (viewType == AdapterMessage.ViewType.FOLDER && - folders.size() == 1 && - folders.get(0).last_sync != null) { - tvLastSync.setText(DateUtils.getRelativeTimeSpanString(context, - folders.get(0).last_sync, true)); - grpLastSync.setVisibility(View.VISIBLE); - } else - grpLastSync.setVisibility(View.GONE); + tvLastSync.setText(syncTime == null ? null + : DateUtils.getRelativeTimeSpanString(context, syncTime, true)); + grpLastSync.setVisibility(syncTime == null ? View.GONE : View.VISIBLE); fabError.setTag(accountErrors); if (folderErrors || accountErrors)