mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 20:54:34 +00:00
Fixed clearing list cache
This commit is contained in:
parent
5caba684ca
commit
2b51aa00a2
1 changed files with 11 additions and 8 deletions
|
@ -92,9 +92,6 @@ public class ViewModelMessages extends ViewModel {
|
|||
boolean legacy = prefs.getBoolean("legacy_queries", false);
|
||||
boolean cache_lists = prefs.getBoolean("cache_lists", true);
|
||||
|
||||
if (!cache_lists)
|
||||
models.clear();
|
||||
|
||||
Args args = new Args(context,
|
||||
viewType, type, account, folder,
|
||||
thread, id, threading,
|
||||
|
@ -295,12 +292,18 @@ public class ViewModelMessages extends ViewModel {
|
|||
}
|
||||
});
|
||||
|
||||
if (cache_lists) {
|
||||
if (viewType == AdapterMessage.ViewType.UNIFIED)
|
||||
models.remove(AdapterMessage.ViewType.FOLDER);
|
||||
|
||||
if (viewType != AdapterMessage.ViewType.SEARCH &&
|
||||
viewType != AdapterMessage.ViewType.THREAD)
|
||||
models.remove(AdapterMessage.ViewType.SEARCH);
|
||||
} else {
|
||||
for (AdapterMessage.ViewType v : AdapterMessage.ViewType.values())
|
||||
if (v != viewType)
|
||||
models.remove(v);
|
||||
}
|
||||
|
||||
if (viewType != AdapterMessage.ViewType.THREAD) {
|
||||
last = viewType;
|
||||
|
|
Loading…
Reference in a new issue