Ensure that the collections gallery reloads when a collection is updated

This commit is contained in:
Vishnu Mohandas 2020-10-31 23:29:00 +05:30
parent 9c785ef73e
commit 5170877e36
2 changed files with 4 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import 'dart:math';
import 'package:logging/logging.dart';
import 'package:photos/core/event_bus.dart';
import 'package:photos/db/files_db.dart';
import 'package:photos/events/collection_updated_event.dart';
import 'package:photos/events/photo_upload_event.dart';
import 'package:photos/events/user_authenticated_event.dart';
import 'package:photos/services/collections_service.dart';
@ -177,6 +178,7 @@ class SyncService {
if (diff.isNotEmpty) {
await _storeDiff(diff, collectionID);
FileRepository.instance.reloadFiles();
Bus.instance.fire(CollectionUpdatedEvent());
if (diff.length == _diffLimit) {
return await _fetchEncryptedFilesDiff(collectionID);
}

View file

@ -228,6 +228,8 @@ class EmailItemWidget extends StatelessWidget {
await CollectionsService.instance
.unshare(collectionID, email);
await dialog.hide();
showToast("Stopped sharing with " + email + ".");
Navigator.of(context).pop();
} catch (e, s) {
Logger("EmailItemWidget").severe(e, s);
await dialog.hide();