Skip to content

armgit / ente

Public Imported from GitHub
0

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

Dedup

Manav Rathi912279e3cf0b
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index c8efb46bd3..4f03254033 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -32,10 +32,10 @@ import { shouldShowWhatsNew } from "@/new/photos/services/changelog";
import {
ALL_SECTION,
DUMMY_UNCATEGORIZED_COLLECTION,
- getAllLocalCollections,
isHiddenCollection,
} from "@/new/photos/services/collection";
import { areOnlySystemCollections } from "@/new/photos/services/collection/ui";
+import { getAllLocalCollections } from "@/new/photos/services/collections";
import {
getLocalFiles,
getLocalTrashedFiles,
diff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.ts
index e014b2cb29..c242ae1bca 100644
--- a/web/apps/photos/src/services/export/index.ts
+++ b/web/apps/photos/src/services/export/index.ts
@@ -14,9 +14,9 @@ import { FileType } from "@/media/file-type";
import { decodeLivePhoto } from "@/media/live-photo";
import {
createCollectionNameByID,
- getAllLocalCollections,
getCollectionUserFacingName,
} from "@/new/photos/services/collection";
+import { getAllLocalCollections } from "@/new/photos/services/collections";
import {
exportMetadataDirectoryName,
exportTrashDirectoryName,
diff --git a/web/packages/new/photos/services/collection/index.ts b/web/packages/new/photos/services/collection/index.ts
index d51e90ca56..7fd323b250 100644
--- a/web/packages/new/photos/services/collection/index.ts
+++ b/web/packages/new/photos/services/collection/index.ts
@@ -1,6 +1,5 @@
import { SUB_TYPE, type Collection } from "@/media/collection";
import { ItemVisibility } from "@/media/file-metadata";
-import localForage from "@ente/shared/storage/localForage";
import type { User } from "@ente/shared/user/types";
export const ARCHIVE_SECTION = -1;
@@ -9,23 +8,6 @@ export const DUMMY_UNCATEGORIZED_COLLECTION = -3;
export const HIDDEN_ITEMS_SECTION = -4;
export const ALL_SECTION = 0;
-const COLLECTION_TABLE = "collections";
-
-export const getLocalCollections = async (
- type: "normal" | "hidden" = "normal",
-): Promise<Collection[]> => {
- const collections = await getAllLocalCollections();
- return type == "normal"
- ? collections.filter((c) => !isHiddenCollection(c))
- : collections.filter((c) => isHiddenCollection(c));
-};
-
-export const getAllLocalCollections = async (): Promise<Collection[]> => {
- const collections: Collection[] =
- (await localForage.getItem(COLLECTION_TABLE)) ?? [];
- return collections;
-};
-
/**
* Return true if this is a default hidden collection.
*