bugfix: deleting an entry removed it from source, but sorted entries were not updated
This commit is contained in:
parent
dad5f080c2
commit
437417eb4e
1 changed files with 2 additions and 1 deletions
|
@ -70,7 +70,7 @@ class CollectionLens with ChangeNotifier {
|
||||||
|
|
||||||
List<ImageEntry> get sortedEntries {
|
List<ImageEntry> get sortedEntries {
|
||||||
if (_sortedEntries == null) {
|
if (_sortedEntries == null) {
|
||||||
_sortedEntries = List.unmodifiable(sections.entries.expand((e) => e.value));
|
_sortedEntries = List.of(sections.entries.expand((e) => e.value));
|
||||||
}
|
}
|
||||||
return _sortedEntries;
|
return _sortedEntries;
|
||||||
}
|
}
|
||||||
|
@ -186,6 +186,7 @@ class CollectionLens with ChangeNotifier {
|
||||||
void onEntryRemoved(ImageEntry entry) {
|
void onEntryRemoved(ImageEntry entry) {
|
||||||
// do not apply sort/group as section order change would surprise the user while browsing
|
// do not apply sort/group as section order change would surprise the user while browsing
|
||||||
_filteredEntries.remove(entry);
|
_filteredEntries.remove(entry);
|
||||||
|
_sortedEntries?.remove(entry);
|
||||||
sections.forEach((key, entries) => entries.remove(entry));
|
sections.forEach((key, entries) => entries.remove(entry));
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue