diff --git a/lib/ui/collection_action_sheet.dart b/lib/ui/collection_action_sheet.dart index 24207d33f..8eaadc950 100644 --- a/lib/ui/collection_action_sheet.dart +++ b/lib/ui/collection_action_sheet.dart @@ -324,7 +324,6 @@ class _CollectionActionSheetState extends State { } Future _albumListItemOnTap(CollectionWithThumbnail item) async { - bool showLongToast = false; if (await _runCollectionAction(collection: item.collection)) { late final String toastMessage; bool shouldNavigateToCollection = false; @@ -334,20 +333,14 @@ class _CollectionActionSheetState extends State { } else if (widget.actionType == CollectionActionType.moveFiles) { toastMessage = "Moved successfully to " + item.collection.name!; shouldNavigateToCollection = true; - } else if (widget.actionType == CollectionActionType.collectPhotos) { - toastMessage = - "Collaborative link created for " + item.collection.name!; - showLongToast = true; } else { toastMessage = ""; } if (toastMessage.isNotEmpty) { - showLongToast - ? showToast(context, toastMessage) - : showShortToast( - context, - toastMessage, - ); + showShortToast( + context, + toastMessage, + ); } if (shouldNavigateToCollection) { _navigateToCollection( @@ -440,8 +433,19 @@ class _CollectionActionSheetState extends State { return Future.value(false); } else { try { - await CollectionsService.instance - .updateShareUrl(collection, {'enableCollect': true}); + unawaited( + routeToPage( + context, + ShareCollectionPage(collection), + ), + ); + CollectionsService.instance + .updateShareUrl(collection, {'enableCollect': true}).then( + (value) => showToast( + context, + "Collaborative link created for " + collection.name!, + ), + ); return true; } catch (e) { showGenericErrorDialog(context: context); @@ -455,6 +459,10 @@ class _CollectionActionSheetState extends State { enableCollect: true, ); if (result) { + showToast( + context, + "Collaborative link created for " + collection.name!, + ); if (Configuration.instance.getUserID() == collection.owner!.id) { unawaited( routeToPage( diff --git a/lib/ui/home_widget.dart b/lib/ui/home_widget.dart index d83941054..6909450e3 100644 --- a/lib/ui/home_widget.dart +++ b/lib/ui/home_widget.dart @@ -40,10 +40,10 @@ import 'package:photos/ui/home/landing_page_widget.dart'; import 'package:photos/ui/home/preserve_footer_widget.dart'; import 'package:photos/ui/home/start_backup_hook_widget.dart'; import 'package:photos/ui/loading_photos_widget.dart'; -import "package:photos/ui/new_shared_collections_gallery.dart"; import 'package:photos/ui/notification/update/change_log_page.dart'; import 'package:photos/ui/settings/app_update_dialog.dart'; import 'package:photos/ui/settings_page.dart'; +import "package:photos/ui/shared_collections_gallery.dart"; import 'package:photos/utils/dialog_util.dart'; import 'package:receive_sharing_intent/receive_sharing_intent.dart'; import 'package:uni_links/uni_links.dart'; @@ -59,8 +59,7 @@ class HomeWidget extends StatefulWidget { class _HomeWidgetState extends State { static const _deviceFolderGalleryWidget = CollectionsGalleryWidget(); - // static const _sharedCollectionGallery = SharedCollectionGallery(); - static const _sharedCollectionGallery = NewSharedCollectionsGallery(); + static const _sharedCollectionGallery = SharedCollectionGallery(); static final _settingsPage = SettingsPage( emailNotifier: UserService.instance.emailValueNotifier, ); diff --git a/lib/ui/shared_collections_gallery.dart b/lib/ui/shared_collections_gallery.dart index 2820e60b4..0c05335c2 100644 --- a/lib/ui/shared_collections_gallery.dart +++ b/lib/ui/shared_collections_gallery.dart @@ -19,6 +19,7 @@ import 'package:photos/theme/colors.dart'; import 'package:photos/ui/collections/section_title.dart'; import 'package:photos/ui/common/gradient_button.dart'; import 'package:photos/ui/common/loading_widget.dart'; +import "package:photos/ui/new_shared_collections_gallery.dart"; import 'package:photos/ui/sharing/user_avator_widget.dart'; import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; import 'package:photos/ui/viewer/gallery/collection_page.dart'; @@ -122,6 +123,10 @@ class _SharedCollectionGalleryState extends State }), builder: (context, snapshot) { if (snapshot.hasData) { + if ((snapshot.data?.incoming.length ?? 0) == 0 && + (snapshot.data?.outgoing.length ?? 0) == 0) { + return const Center(child: EmptyStateWidget()); + } return _getSharedCollectionsGallery(snapshot.data!); } else if (snapshot.hasError) { _logger.severe(