فهرست منبع

Fix typos and dispose valueNotifier

Neeraj Gupta 2 سال پیش
والد
کامیت
c2d2caa05b

+ 3 - 3
lib/services/collections_service.dart

@@ -392,12 +392,12 @@ class CollectionsService {
     }
   }
 
-  Future<void> trashEmptyCollections(Collection collection) async {
+  Future<void> trashEmptyCollection(Collection collection) async {
     try {
-      // While trashing empty albums, we must pass keeFiles flag as True.
+      // While trashing empty albums, we must pass keepFiles flag as True.
       // The server will verify that the collection is actually empty before
       // deleting the files. If keepFiles is set as False and the collection
-      // is not empty, then the files in the collections will be moved to trash
+      // is not empty, then the files in the collections will be moved to trash.
       await _enteDio.delete(
         "/collections/v3/${collection.id}?keepFiles=True&collectionID=${collection.id}",
       );

+ 0 - 1
lib/ui/components/button_widget.dart

@@ -63,7 +63,6 @@ class ButtonWidget extends StatelessWidget {
 
   /// progressStatus can be used to display information about the action
   /// progress when ExecutionState is in Progress.
-  // when
   final ValueNotifier<String>? progressStatus;
 
   const ButtonWidget({

+ 7 - 1
lib/ui/viewer/actions/delete_empty_albums.dart

@@ -18,6 +18,12 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
   final ValueNotifier<String> _deleteProgress = ValueNotifier("");
   bool _isCancelled = false;
 
+  @override
+  void dispose() {
+    _deleteProgress.dispose();
+    super.dispose();
+  }
+
   @override
   Widget build(BuildContext context) {
     return Align(
@@ -89,7 +95,7 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
             "${collections.length} ";
         try {
           await CollectionsService.instance
-              .trashEmptyCollections(collections[i].collection);
+              .trashEmptyCollection(collections[i].collection);
         } catch (_) {
           failedCount++;
         }