Fix typos and dispose valueNotifier

This commit is contained in:
Neeraj Gupta 2023-01-03 14:30:10 +05:30
parent d8847ef572
commit c2d2caa05b
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
3 changed files with 10 additions and 5 deletions

View file

@ -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}",
);

View file

@ -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({

View file

@ -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++;
}