[mob] Avoid redundant event (#5351)

## Description

## Tests
This commit is contained in:
Neeraj
2025-03-18 11:11:56 +05:30
committed by GitHub

View File

@@ -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);
}