Skip to content

armgit / ente

Public Imported from GitHub
0

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

Avoid redundant event

Neeraj Guptac145412b9f04
diff --git a/mobile/lib/services/sync/local_sync_service.dart b/mobile/lib/services/sync/local_sync_service.dart
index a0bc54437e..aa630c2d73 100644
--- a/mobile/lib/services/sync/local_sync_service.dart
+++ b/mobile/lib/services/sync/local_sync_service.dart
@@ -296,10 +296,12 @@ class LocalSyncService {
files,
conflictAlgorithm: SqliteAsyncConflictAlgorithm.ignore,
);
- _logger.info('Inserted ${files.length} files');
- Bus.instance.fire(
- LocalPhotosUpdatedEvent(allFiles, source: "loadedPhoto"),
- );
+ _logger.info('Inserted ${files.length} out of ${allFiles.length} files');
+ if (allFiles.isNotEmpty) {
+ Bus.instance.fire(
+ LocalPhotosUpdatedEvent(allFiles, source: "loadedPhoto"),
+ );
+ }
}
await _prefs.setInt(kDbUpdationTimeKey, toTime);
}