Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathib4533a5a6154
diff --git a/web/packages/new/photos/components/gallery/reducer.ts b/web/packages/new/photos/components/gallery/reducer.ts
index 3d60702c24..f70c0d45b3 100644
--- a/web/packages/new/photos/components/gallery/reducer.ts
+++ b/web/packages/new/photos/components/gallery/reducer.ts
@@ -1,7 +1,11 @@
//TODO Review entire file
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
-import { CollectionType, type Collection } from "@/media/collection";
+import {
+ COLLECTION_ROLE,
+ CollectionType,
+ type Collection,
+} from "@/media/collection";
import type { EnteFile } from "@/media/file";
import type { User } from "@ente/shared/user/types";
import { t } from "i18next";
@@ -13,7 +17,6 @@ import {
getDefaultHiddenCollectionIDs,
HIDDEN_ITEMS_SECTION,
isDefaultHiddenCollection,
- isIncomingCollabShare,
isIncomingShare,
TRASH_SECTION,
} from "../../services/collection";
@@ -338,6 +341,13 @@ const getCollectionCoverFiles = (
return coverFiles;
};
+function isIncomingCollabShare(collection: Collection, user: User) {
+ // TODO: Need to audit the types
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+ const sharee = collection.sharees?.find((sharee) => sharee.id === user.id);
+ return sharee?.role === COLLECTION_ROLE.COLLABORATOR;
+}
+
function isOutgoingShare(collection: Collection, user: User): boolean {
return collection.owner.id === user.id && collection.sharees?.length > 0;
}
diff --git a/web/packages/new/photos/services/collection/index.ts b/web/packages/new/photos/services/collection/index.ts
index 1ce28c63cd..122ebc832a 100644
--- a/web/packages/new/photos/services/collection/index.ts
+++ b/web/packages/new/photos/services/collection/index.ts
@@ -1,4 +1,4 @@
-import { COLLECTION_ROLE, SUB_TYPE, type Collection } from "@/media/collection";
+import { SUB_TYPE, type Collection } from "@/media/collection";
import type { User } from "@ente/shared/user/types";
export const ARCHIVE_SECTION = -1;
@@ -23,10 +23,3 @@ export const isDefaultHiddenCollection = (collection: Collection) =>
export function isIncomingShare(collection: Collection, user: User) {
return collection.owner.id !== user.id;
}
-
-export function isIncomingCollabShare(collection: Collection, user: User) {
- // TODO: Need to audit the types
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
- const sharee = collection.sharees?.find((sharee) => sharee.id === user.id);
- return sharee?.role === COLLECTION_ROLE.COLLABORATOR;
-}