Fixed clearing list cache

pull/215/head
M66B 5 months ago
parent 5caba684ca
commit 2b51aa00a2

@ -92,9 +92,6 @@ public class ViewModelMessages extends ViewModel {
boolean legacy = prefs.getBoolean("legacy_queries", false); boolean legacy = prefs.getBoolean("legacy_queries", false);
boolean cache_lists = prefs.getBoolean("cache_lists", true); boolean cache_lists = prefs.getBoolean("cache_lists", true);
if (!cache_lists)
models.clear();
Args args = new Args(context, Args args = new Args(context,
viewType, type, account, folder, viewType, type, account, folder,
thread, id, threading, thread, id, threading,
@ -295,12 +292,18 @@ public class ViewModelMessages extends ViewModel {
} }
}); });
if (cache_lists) {
if (viewType == AdapterMessage.ViewType.UNIFIED) if (viewType == AdapterMessage.ViewType.UNIFIED)
models.remove(AdapterMessage.ViewType.FOLDER); models.remove(AdapterMessage.ViewType.FOLDER);
if (viewType != AdapterMessage.ViewType.SEARCH && if (viewType != AdapterMessage.ViewType.SEARCH &&
viewType != AdapterMessage.ViewType.THREAD) viewType != AdapterMessage.ViewType.THREAD)
models.remove(AdapterMessage.ViewType.SEARCH); models.remove(AdapterMessage.ViewType.SEARCH);
} else {
for (AdapterMessage.ViewType v : AdapterMessage.ViewType.values())
if (v != viewType)
models.remove(v);
}
if (viewType != AdapterMessage.ViewType.THREAD) { if (viewType != AdapterMessage.ViewType.THREAD) {
last = viewType; last = viewType;

Loading…
Cancel
Save