1
0
Fork 0
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:
M66B 2024-07-21 21:14:00 +02:00
parent 5caba684ca
commit 2b51aa00a2

View file

@ -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;