Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix: Unselect all selected grids on sort change

Neeraj Guptaeb5e47c12d68
diff --git a/lib/ui/tools/deduplicate_page.dart b/lib/ui/tools/deduplicate_page.dart
index 048d6cb2a4..428d35b3f0 100644
--- a/lib/ui/tools/deduplicate_page.dart
+++ b/lib/ui/tools/deduplicate_page.dart
@@ -39,10 +39,12 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
late List<DuplicateFiles> _duplicates;
SortKey sortKey = SortKey.size;
+ late ValueNotifier<String> _deleteProgress;
@override
void initState() {
_duplicates = widget.duplicates;
+ _deleteProgress = ValueNotifier("");
_selectAllGrids();
super.initState();
}
@@ -214,7 +216,15 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
),
onSelected: (int index) {
setState(() {
- sortKey = SortKey.values[index];
+ final newKey = SortKey.values[index];
+ if (newKey == sortKey) {
+ return;
+ } else {
+ sortKey = newKey;
+ if (selectedGrids.length != _duplicates.length) {
+ selectedGrids.clear();
+ }
+ }
});
},
itemBuilder: (context) {