Hide favorite colleciton if it's empty
This commit is contained in:
parent
59f802edd0
commit
502af89e57
|
@ -66,6 +66,10 @@ class FavoritesService {
|
|||
}
|
||||
}
|
||||
|
||||
bool hasFavorites() {
|
||||
return _cachedFavUploadedIDs.isNotEmpty;
|
||||
}
|
||||
|
||||
static FavoritesService instance = FavoritesService._privateConstructor();
|
||||
|
||||
void clearCache() {
|
||||
|
|
|
@ -13,6 +13,7 @@ import 'package:photos/extensions/list.dart';
|
|||
import "package:photos/generated/l10n.dart";
|
||||
import 'package:photos/models/collection.dart';
|
||||
import 'package:photos/services/collections_service.dart';
|
||||
import "package:photos/services/favorites_service.dart";
|
||||
import "package:photos/ui/collections/button/archived_button.dart";
|
||||
import "package:photos/ui/collections/button/hidden_button.dart";
|
||||
import "package:photos/ui/collections/button/trash_button.dart";
|
||||
|
@ -93,12 +94,11 @@ class _UserCollectionsTabState extends State<UserCollectionsTab>
|
|||
(element) => element.type == CollectionType.favorites,
|
||||
);
|
||||
|
||||
// Hide fav collection if it's empty and not shared
|
||||
// favMathResult.matched.removeWhere(
|
||||
// (element) =>
|
||||
// element.thumbnail == null &&
|
||||
// (element.collection.publicURLs?.isEmpty ?? false),
|
||||
// );
|
||||
// Hide fav collection if it's empty
|
||||
if (!FavoritesService.instance.hasFavorites()) {
|
||||
favMathResult.matched.clear();
|
||||
}
|
||||
|
||||
late Map<int, int> collectionIDToNewestPhotoTime;
|
||||
if (sortKey == AlbumSortKey.newestPhoto) {
|
||||
collectionIDToNewestPhotoTime =
|
||||
|
|
Loading…
Reference in a new issue