Handle remove files from shared album

This commit is contained in:
Neeraj Gupta 2022-12-15 21:55:29 +05:30
parent dbe5747104
commit a7ca764805
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -104,7 +104,9 @@ class _FileSelectionActionWidgetState extends State<FileSelectionActionWidget> {
leadingIcon: Icons.remove_outlined,
labelText: "Remove from album$suffix",
menuItemColor: colorScheme.fillFaint,
onTap: _removeFilesFromAlbum,
onTap: split.ownedByCurrentUser.isNotEmpty
? _removeFilesFromAlbum
: null,
),
);
}
@ -210,6 +212,12 @@ class _FileSelectionActionWidgetState extends State<FileSelectionActionWidget> {
}
Future<void> _removeFilesFromAlbum() async {
if (split.pendingUploads.isNotEmpty || split.ownedByOtherUsers.isNotEmpty) {
widget.selectedFiles
.unSelectAll(split.pendingUploads.toSet(), skipNotify: true);
widget.selectedFiles
.unSelectAll(split.ownedByOtherUsers.toSet(), skipNotify: true);
}
await collectionActions.showRemoveFromCollectionSheet(
context,
widget.collection!,