π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Fix sort order setting not reflecting on public link opened in-app
ashilkn21f0602161da
diff --git a/mobile/lib/services/collections_service.dart b/mobile/lib/services/collections_service.dartindex 659113aeee..38b54af8f0 100644--- a/mobile/lib/services/collections_service.dart+++ b/mobile/lib/services/collections_service.dart@@ -1067,6 +1067,24 @@ class CollectionsService {_cachedPublicAlbumToken[collection.id] = authToken!;_cachedPublicCollectionID.add(collection.id);_cachedPublicAlbumKey[collection.id] = albumKey;++ if (collectionData['pubMagicMetadata'] != null) {+ final utfEncodedMmd = await CryptoUtil.decryptChaCha(+ CryptoUtil.base642bin(collectionData['pubMagicMetadata']['data']),+ collectionKey,+ CryptoUtil.base642bin(+ collectionData['pubMagicMetadata']['header'],+ ),+ );+ collection.mMdPubEncodedJson = utf8.decode(utfEncodedMmd);+ collection.mMbPubVersion =+ collectionData['pubMagicMetadata']['version'];+ collection.pubMagicMetadata =+ CollectionPubMagicMetadata.fromEncodedJson(+ collection.mMdPubEncodedJson ?? '{}',+ );+ }+collection.setName(_getDecryptedCollectionName(collection));return collection;} catch (e, s) {diff --git a/mobile/lib/ui/tabs/home_widget.dart b/mobile/lib/ui/tabs/home_widget.dartindex 73ed33d428..2c10c300f4 100644--- a/mobile/lib/ui/tabs/home_widget.dart+++ b/mobile/lib/ui/tabs/home_widget.dart@@ -306,8 +306,12 @@ class _HomeWidgetState extends State<HomeWidget> {if (result) {await dialog.show();- final List<EnteFile> sharedFiles = await _diffFetcher- .getPublicFiles(context, collection.id);+ final List<EnteFile> sharedFiles =+ await _diffFetcher.getPublicFiles(+ context,+ collection.id,+ collection.pubMagicMetadata.asc ?? false,+ );await dialog.hide();Navigator.of(context).pop();@@ -334,8 +338,11 @@ class _HomeWidgetState extends State<HomeWidget> {} else {await dialog.show();- final List<EnteFile> sharedFiles =- await _diffFetcher.getPublicFiles(context, collection.id);+ final List<EnteFile> sharedFiles = await _diffFetcher.getPublicFiles(+ context,+ collection.id,+ collection.pubMagicMetadata.asc ?? false,+ );await dialog.hide();await routeToPage(diff --git a/mobile/lib/utils/diff_fetcher.dart b/mobile/lib/utils/diff_fetcher.dartindex 4cf989f9ae..3bcf22b7d0 100644--- a/mobile/lib/utils/diff_fetcher.dart+++ b/mobile/lib/utils/diff_fetcher.dart@@ -21,6 +21,7 @@ class DiffFetcher {Future<List<EnteFile>> getPublicFiles(BuildContext context,int collectionID,+ bool sortAsc,) async {try {final authToken = await CollectionsService.instance@@ -95,7 +96,9 @@ class DiffFetcher {sinceTime = diff.last["updationTime"];}} while (hasMore);-+ if (sortAsc) {+ sharedFiles.sort((a, b) => a.creationTime!.compareTo(b.creationTime!));+ }return sharedFiles;} catch (e, s) {_logger.severe("Failed to decrypt collection ", e, s);