Skip to content

armgit / ente

Public Imported from GitHub
0

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

improve(AllAlbums):readablity

Aswin Asok3009b2fd667b
diff --git a/web/apps/photos/src/components/Collections/AllAlbums.tsx b/web/apps/photos/src/components/Collections/AllAlbums.tsx
index 21cf707cab..a4e3d82215 100644
--- a/web/apps/photos/src/components/Collections/AllAlbums.tsx
+++ b/web/apps/photos/src/components/Collections/AllAlbums.tsx
@@ -213,15 +213,14 @@ export const AllAlbums: React.FC<AllAlbums> = ({
const visibleAlbumFilters = useMemo(
() =>
- albumFilters.filter(
- ({ value }) =>
- value == "all" ||
- (value == "empty-albums"
- ? hasEnoughEmptyAlbums
- : collectionSummaries.some((cs) =>
- matchesAlbumFilter(cs, value),
- )),
- ),
+ albumFilters.filter(({ value }) => {
+ if (value == "all") return true;
+ if (value == "empty-albums") return hasEnoughEmptyAlbums;
+
+ return collectionSummaries.some((cs) =>
+ matchesAlbumFilter(cs, value),
+ );
+ }),
[collectionSummaries, hasEnoughEmptyAlbums],
);