π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fixup! [mobile][photos] polish memory lane card
Priyanshu Dangaref2ba127d4564
diff --git a/mobile/apps/photos/lib/ui/home/memories/memories_strip.dart b/mobile/apps/photos/lib/ui/home/memories/memories_strip.dartindex c405f126f8..454fbd2553 100644--- a/mobile/apps/photos/lib/ui/home/memories/memories_strip.dart+++ b/mobile/apps/photos/lib/ui/home/memories/memories_strip.dart@@ -7,6 +7,7 @@ import "package:ente_pure_utils/ente_pure_utils.dart";import 'package:flutter/material.dart';import "package:flutter_animate/flutter_animate.dart";import "package:photos/core/event_bus.dart";+import "package:photos/db/files_db.dart";import "package:photos/db/ml/db.dart";import "package:photos/db/offline_files_db.dart";import "package:photos/events/collection_updated_event.dart";@@ -533,14 +534,27 @@ class _MemoriesStripWidgetState extends State<MemoriesStripWidget> {// TODO: Recompute the timeline instead of hiding the card.Future<void> _onCollectionUpdated(CollectionUpdatedEvent event) async {- if (!mounted ||- _memoryLane == null ||- isLocalGalleryMode ||- event.type != EventType.deletedFromRemote ||- event.updatedFiles.isNotEmpty) {+ final memoryLane = _memoryLane;+ if (!mounted || memoryLane == null || isLocalGalleryMode) {return;}- await _hideMemoryLaneIfFilesMissing();+ if (event.type == EventType.hide && event.collectionID != null) {+ final files = await FilesDB.instance.getAllFilesFromCollections({+ event.collectionID!,+ });+ final hiddenFileIds = files.map((file) => file.uploadedFileID).toSet();+ if (!mounted || _memoryLane != memoryLane) {+ return;+ }+ if (memoryLane.entries.any(+ (entry) => hiddenFileIds.contains(entry.fileId),+ )) {+ _hideMemoryLane();+ }+ } else if (event.type == EventType.deletedFromRemote &&+ event.updatedFiles.isEmpty) {+ await _hideMemoryLaneIfFilesMissing();+ }}Future<void> _hideMemoryLaneIfFilesMissing() async {diff --git a/mobile/apps/photos/lib/utils/magic_util.dart b/mobile/apps/photos/lib/utils/magic_util.dartindex 183c2019bf..2112433ed8 100644--- a/mobile/apps/photos/lib/utils/magic_util.dart+++ b/mobile/apps/photos/lib/utils/magic_util.dart@@ -103,6 +103,12 @@ Future<void> changeCollectionVisibility(collection.id,const <EnteFile>[],'collection_visibility_changed',+ type: switch (visibilityAction) {+ _VisibilityAction.hide => EventType.hide,+ _VisibilityAction.unHide => EventType.unhide,+ _VisibilityAction.archive => EventType.archived,+ _VisibilityAction.unarchive => EventType.unarchived,+ },),);// Reload so the home gallery adds or removes the collection's files.