Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Fix correct sort

laurenspriem7b5ed1deaa08
diff --git a/mobile/lib/services/smart_memories_service.dart b/mobile/lib/services/smart_memories_service.dart
index ff1e0a94f3..d8a5b33c87 100644
--- a/mobile/lib/services/smart_memories_service.dart
+++ b/mobile/lib/services/smart_memories_service.dart
@@ -76,6 +76,7 @@ class SmartMemoriesService {
MemoriesCache oldCache,
) async {
try {
+ _logger.finest('calcMemories called with time: $now');
await init();
final List<SmartMemory> memories = [];
final allFiles = Set<EnteFile>.from(
@@ -1163,6 +1164,9 @@ class SmartMemoriesService {
for (var yearAgo = 1; yearAgo <= yearsBefore; yearAgo++) {
final memories = yearsAgoToMemories[yearAgo];
if (memories == null) continue;
+ memories.sort(
+ (a, b) => a.file.creationTime!.compareTo(b.file.creationTime!),
+ );
final fillerMemory = FillerMemory(
memories,
"TEST",