Sort collection by name during Add/Move/Restore flow

This commit is contained in:
Neeraj Gupta 2022-06-24 14:38:48 +05:30
parent 1b9e7dcc13
commit 083c52fbca
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -213,8 +213,8 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
}
}
collectionsWithThumbnail.sort((first, second) {
return second.collection.updationTime
.compareTo(first.collection.updationTime);
return (first.collection.name ?? "")
.compareTo((second.collection.name ?? ""));
});
return collectionsWithThumbnail;
}
@ -311,9 +311,10 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
fromCollectionID,
widget.selectedFiles.files?.toList(),
);
await dialog.hide();
RemoteSyncService.instance.sync(silently: true);
widget.selectedFiles?.clearAll();
await dialog.hide();
return true;
} on AssertionError catch (e, s) {
await dialog.hide();