Fix typos and dispose valueNotifier
This commit is contained in:
parent
d8847ef572
commit
c2d2caa05b
3 changed files with 10 additions and 5 deletions
|
@ -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}",
|
||||
);
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue