Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob] Handle albums with download disabled

Neeraj Gupta7062aacf350a
diff --git a/mobile/lib/services/collections_service.dart b/mobile/lib/services/collections_service.dart
index ccfd9e0c89..9cae4c5c93 100644
--- a/mobile/lib/services/collections_service.dart
+++ b/mobile/lib/services/collections_service.dart
@@ -1165,7 +1165,7 @@ class CollectionsService {
options: Options(
headers: {
"X-Auth-Access-Token": authToken,
- "X-Auth-JWT-Token": jwtToken,
+ "X-Auth-Access-Token-JWT": jwtToken,
},
),
);
diff --git a/mobile/lib/ui/tabs/home_widget.dart b/mobile/lib/ui/tabs/home_widget.dart
index a947517f29..578300500b 100644
--- a/mobile/lib/ui/tabs/home_widget.dart
+++ b/mobile/lib/ui/tabs/home_widget.dart
@@ -279,6 +279,14 @@ class _HomeWidgetState extends State<HomeWidget> {
}
final dialog = createProgressDialog(context, "Loading...");
final publicUrl = collection.publicURLs![0];
+ if (!publicUrl!.enableDownload) {
+ await showErrorDialog(
+ context,
+ "Cannot open this album",
+ "Sorry, this album cannot be opened in the app.",
+ );
+ return;
+ }
if (publicUrl!.passwordEnabled) {
await showTextInputDialog(
context,
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 68b8e43866..f96eedc463 100644
--- a/mobile/lib/ui/viewer/gallery/shared_public_collection_page.dart
+++ b/mobile/lib/ui/viewer/gallery/shared_public_collection_page.dart
@@ -66,9 +66,7 @@ class _SharedPublicCollectionPageState
@override
Widget build(BuildContext context) {
- logger.info(
- "Building SharedPublicCollectionPage ${widget.c.collection.isJoinEnabled}",
- );
+ logger.info("Building SharedPublicCollectionPage");
final List<EnteFile>? initialFiles =
widget.c.thumbnail != null ? [widget.c.thumbnail!] : null;
final gallery = Gallery(
@@ -161,15 +159,10 @@ class _SharedPublicCollectionPageState
);
await dialog.show();
try {
- logger.info("Joining collection ${widget.c.collection.id}");
await RemoteSyncService.instance
.joinAndSyncCollection(context, widget.c.collection.id);
- logger.info("Syncing collections");
-
- // route to the collection
final c =
CollectionsService.instance.getCollectionByID(widget.c.collection.id);
- logger.info("Joining collection ${widget.c.collection.id}");
await dialog.hide();
Navigator.of(context).pop();
await routeToPage(
@@ -180,8 +173,6 @@ class _SharedPublicCollectionPageState
logger.severe("Failed to join collection", e, s);
await dialog.hide();
showToast(context, S.of(context).somethingWentWrong);
- // wait for 400ms to show the error dialog
- await Future.delayed(const Duration(milliseconds: 400));
}
}
}