Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Show confirmation dialog before joining public link

ashilknb1d2de712b82
diff --git a/mobile/lib/generated/intl/messages_en.dart b/mobile/lib/generated/intl/messages_en.dart
index 16f84068f9..41537dd1ec 100644
--- a/mobile/lib/generated/intl/messages_en.dart
+++ b/mobile/lib/generated/intl/messages_en.dart
@@ -1063,6 +1063,8 @@ class MessageLookup extends MessageLookupByLibrary {
"Selected items will be removed from this album"),
"join": MessageLookupByLibrary.simpleMessage("Join"),
"joinAlbum": MessageLookupByLibrary.simpleMessage("Join album"),
+ "joinAlbumConfirmationDialogBody": MessageLookupByLibrary.simpleMessage(
+ "Joining an album will make your email visible to its participants."),
"joinAlbumSubtext":
MessageLookupByLibrary.simpleMessage("to view and add your photos"),
"joinAlbumSubtextViewer": MessageLookupByLibrary.simpleMessage(
diff --git a/mobile/lib/generated/l10n.dart b/mobile/lib/generated/l10n.dart
index 7096abda62..c7f32203dd 100644
--- a/mobile/lib/generated/l10n.dart
+++ b/mobile/lib/generated/l10n.dart
@@ -11220,6 +11220,16 @@ class S {
args: [],
);
}
+
+ /// `Joining an album will make your email visible to its participants.`
+ String get joinAlbumConfirmationDialogBody {
+ return Intl.message(
+ 'Joining an album will make your email visible to its participants.',
+ name: 'joinAlbumConfirmationDialogBody',
+ desc: '',
+ args: [],
+ );
+ }
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
diff --git a/mobile/lib/l10n/intl_en.arb b/mobile/lib/l10n/intl_en.arb
index 46b814c91e..9c29390b16 100644
--- a/mobile/lib/l10n/intl_en.arb
+++ b/mobile/lib/l10n/intl_en.arb
@@ -1673,5 +1673,6 @@
"ineligible": "Ineligible",
"failed": "Failed",
"playStream": "Play stream",
- "playOriginal": "Play original"
+ "playOriginal": "Play original",
+ "joinAlbumConfirmationDialogBody" : "Joining an album will make your email visible to its participants."
}
\ No newline at end of file
diff --git a/mobile/lib/ui/viewer/gallery/shared_public_collection_page.dart b/mobile/lib/ui/viewer/gallery/shared_public_collection_page.dart
index 05ad027206..f4905eb4c7 100644
--- a/mobile/lib/ui/viewer/gallery/shared_public_collection_page.dart
+++ b/mobile/lib/ui/viewer/gallery/shared_public_collection_page.dart
@@ -151,27 +151,35 @@ class _SharedPublicCollectionPageState
}
Future<void> _joinAlbum() async {
- final dialog = createProgressDialog(
+ final result = await showChoiceDialog(
context,
- S.of(context).pleaseWait,
- isDismissible: true,
+ title: context.l10n.joinAlbum,
+ body: context.l10n.joinAlbumConfirmationDialogBody,
+ firstButtonLabel: context.l10n.join,
);
- await dialog.show();
- try {
- await RemoteSyncService.instance
- .joinAndSyncCollection(context, widget.c.collection.id);
- final c =
- CollectionsService.instance.getCollectionByID(widget.c.collection.id);
- await dialog.hide();
- Navigator.of(context).pop();
- await routeToPage(
+ if (result != null && result.action == ButtonAction.first) {
+ final dialog = createProgressDialog(
context,
- CollectionPage(CollectionWithThumbnail(c!, null)),
+ S.of(context).pleaseWait,
+ isDismissible: true,
);
- } catch (e, s) {
- logger.severe("Failed to join collection", e, s);
- await dialog.hide();
- showToast(context, S.of(context).somethingWentWrong);
+ await dialog.show();
+ try {
+ await RemoteSyncService.instance
+ .joinAndSyncCollection(context, widget.c.collection.id);
+ final c = CollectionsService.instance
+ .getCollectionByID(widget.c.collection.id);
+ await dialog.hide();
+ Navigator.of(context).pop();
+ await routeToPage(
+ context,
+ CollectionPage(CollectionWithThumbnail(c!, null)),
+ );
+ } catch (e, s) {
+ logger.severe("Failed to join collection", e, s);
+ await dialog.hide();
+ showToast(context, S.of(context).somethingWentWrong);
+ }
}
}
}