Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathic1d976394543
diff --git a/web/apps/photos/src/constants/collection.ts b/web/apps/photos/src/constants/collection.ts
index cc2c000528..8e975da921 100644
--- a/web/apps/photos/src/constants/collection.ts
+++ b/web/apps/photos/src/constants/collection.ts
@@ -57,44 +57,3 @@ export const COLLECTION_SORT_ORDER = new Map([
[CollectionSummaryType.defaultHidden, 7],
]);
-export const SYSTEM_COLLECTION_TYPES = new Set([
- CollectionSummaryType.all,
- CollectionSummaryType.archive,
- CollectionSummaryType.trash,
- CollectionSummaryType.uncategorized,
- CollectionSummaryType.hiddenItems,
- CollectionSummaryType.defaultHidden,
-]);
-
-export const ADD_TO_NOT_ALLOWED_COLLECTION = new Set([
- CollectionSummaryType.all,
- CollectionSummaryType.archive,
- CollectionSummaryType.incomingShareViewer,
- CollectionSummaryType.trash,
- CollectionSummaryType.uncategorized,
- CollectionSummaryType.defaultHidden,
- CollectionSummaryType.hiddenItems,
-]);
-
-export const MOVE_TO_NOT_ALLOWED_COLLECTION = new Set([
- CollectionSummaryType.all,
- CollectionSummaryType.archive,
- CollectionSummaryType.incomingShareViewer,
- CollectionSummaryType.incomingShareCollaborator,
- CollectionSummaryType.trash,
- CollectionSummaryType.uncategorized,
- CollectionSummaryType.defaultHidden,
- CollectionSummaryType.hiddenItems,
-]);
-
-export const OPTIONS_NOT_HAVING_COLLECTION_TYPES = new Set([
- CollectionSummaryType.all,
- CollectionSummaryType.archive,
-]);
-
-export const HIDE_FROM_COLLECTION_BAR_TYPES = new Set([
- CollectionSummaryType.trash,
- CollectionSummaryType.archive,
- CollectionSummaryType.uncategorized,
- CollectionSummaryType.defaultHidden,
-]);
diff --git a/web/apps/photos/src/utils/collection/index.ts b/web/apps/photos/src/utils/collection/index.ts
index b3393da69f..2b9498fd14 100644
--- a/web/apps/photos/src/utils/collection/index.ts
+++ b/web/apps/photos/src/utils/collection/index.ts
@@ -11,14 +11,9 @@ import { getUnixTimeInMicroSecondsWithDelta } from "@ente/shared/time";
import type { User } from "@ente/shared/user/types";
import bs58 from "bs58";
import {
- ADD_TO_NOT_ALLOWED_COLLECTION,
CollectionSummaryType,
CollectionType,
DEFAULT_HIDDEN_COLLECTION_USER_FACING_NAME,
- HIDE_FROM_COLLECTION_BAR_TYPES,
- MOVE_TO_NOT_ALLOWED_COLLECTION,
- OPTIONS_NOT_HAVING_COLLECTION_TYPES,
- SYSTEM_COLLECTION_TYPES,
} from "constants/collection";
import { t } from "i18next";
import {
@@ -46,6 +41,48 @@ import { SetFilesDownloadProgressAttributes } from "types/gallery";
import { downloadFilesWithProgress } from "utils/file";
import { isArchivedCollection, updateMagicMetadata } from "utils/magicMetadata";
+const SYSTEM_COLLECTION_TYPES = new Set([
+ CollectionSummaryType.all,
+ CollectionSummaryType.archive,
+ CollectionSummaryType.trash,
+ CollectionSummaryType.uncategorized,
+ CollectionSummaryType.hiddenItems,
+ CollectionSummaryType.defaultHidden,
+]);
+
+const ADD_TO_NOT_ALLOWED_COLLECTION = new Set([
+ CollectionSummaryType.all,
+ CollectionSummaryType.archive,
+ CollectionSummaryType.incomingShareViewer,
+ CollectionSummaryType.trash,
+ CollectionSummaryType.uncategorized,
+ CollectionSummaryType.defaultHidden,
+ CollectionSummaryType.hiddenItems,
+]);
+
+const MOVE_TO_NOT_ALLOWED_COLLECTION = new Set([
+ CollectionSummaryType.all,
+ CollectionSummaryType.archive,
+ CollectionSummaryType.incomingShareViewer,
+ CollectionSummaryType.incomingShareCollaborator,
+ CollectionSummaryType.trash,
+ CollectionSummaryType.uncategorized,
+ CollectionSummaryType.defaultHidden,
+ CollectionSummaryType.hiddenItems,
+]);
+
+const OPTIONS_NOT_HAVING_COLLECTION_TYPES = new Set([
+ CollectionSummaryType.all,
+ CollectionSummaryType.archive,
+]);
+
+const HIDE_FROM_COLLECTION_BAR_TYPES = new Set([
+ CollectionSummaryType.trash,
+ CollectionSummaryType.archive,
+ CollectionSummaryType.uncategorized,
+ CollectionSummaryType.defaultHidden,
+]);
+
export enum COLLECTION_OPS_TYPE {
ADD,
MOVE,