π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob] Clean up quick collection on error
Neeraj Gupta34a8dc21c650
diff --git a/mobile/lib/ui/actions/collection/collection_sharing_actions.dart b/mobile/lib/ui/actions/collection/collection_sharing_actions.dartindex f9e9feacac..55bec3ad45 100644--- a/mobile/lib/ui/actions/collection/collection_sharing_actions.dart+++ b/mobile/lib/ui/actions/collection/collection_sharing_actions.dart@@ -5,7 +5,6 @@ import 'package:logging/logging.dart';import 'package:photos/core/configuration.dart';import "package:photos/core/errors.dart";import 'package:photos/db/files_db.dart';-import 'package:photos/ente_theme_data.dart';import "package:photos/generated/l10n.dart";import 'package:photos/models/api/collection/create_request.dart';import "package:photos/models/api/collection/user.dart";@@ -110,6 +109,7 @@ class CollectionActions {BuildContext context,List<EnteFile> files,) async {+ late final Collection newCollection;try {// create album with emptyName, use collectionCreationTime on UI to// show name@@ -133,10 +133,21 @@ class CollectionActions {final collection = await collectionsService.createAndCacheCollection(req,);+ newCollection = collection;logger.finest("adding files to share to new album");await collectionsService.addOrCopyToCollection(collection.id, files);logger.finest("creating public link for the newly created album");- await CollectionsService.instance.createShareUrl(collection);+ try {+ await CollectionsService.instance.createShareUrl(collection);+ } catch (e) {+ if (e is SharingNotPermittedForFreeAccountsError) {+ if (newCollection.isQuickLinkCollection() &&+ !newCollection.hasSharees) {+ await trashCollectionKeepingPhotos(newCollection, context);+ }+ rethrow;+ }+ }return collection;} catch (e, s) {if (e is SharingNotPermittedForFreeAccountsError) {