fix(library): keep rows visible during refresh

This commit is contained in:
zarzet
2026-07-28 01:50:54 +07:00
parent 80d9d87870
commit 4c33f112ad
+4 -2
View File
@@ -1185,7 +1185,9 @@ class _QueueTabState extends ConsumerState<QueueTab> {
downloadHistoryProvider.select((state) => state.loadedIndexVersion),
(previous, next) {
if (previous == null || previous == next) return;
_invalidateLibraryDataCaches();
// The family provider already reruns for the new revision. Retain its
// last successful page while SQLite is loading so metadata backfills
// and download completions cannot flash the Library as empty.
_resetLibraryPaging();
if (mounted) setState(() {});
},
@@ -1194,7 +1196,7 @@ class _QueueTabState extends ConsumerState<QueueTab> {
localLibraryProvider.select((state) => state.loadedIndexVersion),
(previous, next) {
if (previous == null || previous == next) return;
_invalidateLibraryDataCaches();
// Keep stale rows visible until the refreshed query replaces them.
_resetLibraryPaging();
if (mounted) setState(() {});
},