Minor changes to sync manager

This commit is contained in:
Vishnu Mohandas 2020-06-18 00:08:49 +05:30
parent dcd34b0d60
commit 46fcd8607f
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ class PhotoRepository {
return true;
}
void reloadPhotos() async {
Future<void> reloadPhotos() async {
_logger.info("Reloading...");
await loadPhotos();
Bus.instance.fire(LocalPhotosUpdatedEvent());

View file

@ -91,6 +91,7 @@ class PhotoSyncManager {
first.createTimestamp.compareTo(second.createTimestamp));
await _updateDatabase(
photos, prefs, lastDBUpdateTimestamp, syncStartTimestamp);
await PhotoRepository.instance.reloadPhotos();
}
await _syncWithRemote(prefs);
}
@ -294,7 +295,6 @@ class PhotoSyncManager {
List<Photo> photos, SharedPreferences prefs, int timestamp) async {
await _db.insertPhotos(photos);
_logger.info("Inserted " + photos.length.toString() + " photos.");
PhotoRepository.instance.reloadPhotos();
return await prefs.setInt(_lastDBUpdateTimestampKey, timestamp);
}
}