π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Tweak
Manav Rathi059c59ed2815
diff --git a/web/packages/new/photos/components/gallery/reducer.ts b/web/packages/new/photos/components/gallery/reducer.tsindex 646251f4a3..b2bc607af4 100644--- a/web/packages/new/photos/components/gallery/reducer.ts+++ b/web/packages/new/photos/components/gallery/reducer.ts@@ -534,12 +534,10 @@ const createCollectionSummaries = (let hasUncategorizedCollection = false;for (const collection of collections) {- if (- !hasUncategorizedCollection &&- collection.type === CollectionType.uncategorized- ) {+ if (collection.type === CollectionType.uncategorized) {hasUncategorizedCollection = true;}+let type: CollectionSummaryType;if (isIncomingShare(collection, user)) {if (isIncomingCollabShare(collection, user)) {@@ -577,34 +575,39 @@ const createCollectionSummaries = (}}- let CollectionSummaryItemName: string;+ let name: string;if (type == "uncategorized") {- CollectionSummaryItemName = t("section_uncategorized");+ name = t("section_uncategorized");} else if (type == "favorites") {- CollectionSummaryItemName = t("favorites");+ name = t("favorites");} else {- CollectionSummaryItemName = collection.name;+ name = collection.name;}const collectionFiles = filesByCollection.get(collection.id);collectionSummaries.set(collection.id, {id: collection.id,- name: CollectionSummaryItemName,+ type,+ name,latestFile: collectionFiles?.[0],coverFile: coverFiles.get(collection.id),fileCount: collectionFiles?.length ?? 0,updationTime: collection.updationTime,- type: type,// eslint-disable-next-line @typescript-eslint/no-unnecessary-conditionorder: collection.magicMetadata?.data?.order ?? 0,});}if (!hasUncategorizedCollection) {- collectionSummaries.set(- DUMMY_UNCATEGORIZED_COLLECTION,- getDummyUncategorizedCollectionSummary(),- );+ collectionSummaries.set(DUMMY_UNCATEGORIZED_COLLECTION, {+ id: DUMMY_UNCATEGORIZED_COLLECTION,+ type: "uncategorized",+ name: t("section_uncategorized"),+ latestFile: undefined,+ coverFile: undefined,+ fileCount: 0,+ updationTime: 0,+ });}return collectionSummaries;@@ -643,38 +646,20 @@ const findCoverFiles = (return coverFiles;};-function isIncomingCollabShare(collection: Collection, user: User) {+const isIncomingCollabShare = (collection: Collection, user: User) => {// TODO: Need to audit the types// eslint-disable-next-line @typescript-eslint/no-unnecessary-conditionconst sharee = collection.sharees?.find((sharee) => sharee.id === user.id);return sharee?.role === COLLECTION_ROLE.COLLABORATOR;-}+};-function isOutgoingShare(collection: Collection, user: User): boolean {+const isOutgoingShare = (collection: Collection, user: User) =>// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition- return collection.owner.id === user.id && collection.sharees?.length > 0;-}+ collection.owner.id === user.id && collection.sharees?.length > 0;-function isSharedOnlyViaLink(collection: Collection) {+const isSharedOnlyViaLink = (collection: Collection) =>// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition- return collection.publicURLs?.length && !collection.sharees?.length;-}--function getDummyUncategorizedCollectionSummary(): CollectionSummary {- return {- id: DUMMY_UNCATEGORIZED_COLLECTION,- name: t("section_uncategorized"),- type: "uncategorized",- latestFile: undefined,- // See: [Note: strict mode migration]- //- // eslint-disable-next-line @typescript-eslint/ban-ts-comment- // @ts-ignore- coverFile: null,- fileCount: 0,- updationTime: 0,- };-}+ collection.publicURLs?.length && !collection.sharees?.length;function getHiddenItemsSummary(hiddenFiles: EnteFile[],diff --git a/web/packages/new/photos/services/collection/index.ts b/web/packages/new/photos/services/collection/index.tsindex 5a3e85de7b..6989467ee5 100644--- a/web/packages/new/photos/services/collection/index.ts+++ b/web/packages/new/photos/services/collection/index.ts@@ -21,9 +21,8 @@ export const isDefaultHiddenCollection = (collection: Collection) =>// eslint-disable-next-line @typescript-eslint/no-unnecessary-conditioncollection.magicMetadata?.data.subType === SUB_TYPE.DEFAULT_HIDDEN;-export function isIncomingShare(collection: Collection, user: User) {- return collection.owner.id !== user.id;-}+export const isIncomingShare = (collection: Collection, user: User) =>+ collection.owner.id !== user.id;export const isHiddenCollection = (collection: Collection) =>// TODO: Need to audit the typesdiff --git a/web/packages/new/photos/services/collection/ui.ts b/web/packages/new/photos/services/collection/ui.tsindex 895110200f..d52d6ad674 100644--- a/web/packages/new/photos/services/collection/ui.ts+++ b/web/packages/new/photos/services/collection/ui.ts@@ -22,15 +22,15 @@ export type CollectionSummaryType =* directly shown in the UI.*/export interface CollectionSummary {- /**- * The "UI" type for the collection or pseudo-collection.- */- type: CollectionSummaryType;/*** The ID of the underlying collection, or one of the predefined placeholder* IDs for the pseudo-collections.*/id: number;+ /**+ * The "UI" type for the collection or pseudo-collection.+ */+ type: CollectionSummaryType;/*** The name of the collection or pseudo-collection.*/diff --git a/web/packages/new/photos/services/magic-metadata.ts b/web/packages/new/photos/services/magic-metadata.tsindex e0cacaa455..d7b78f8964 100644--- a/web/packages/new/photos/services/magic-metadata.ts+++ b/web/packages/new/photos/services/magic-metadata.ts@@ -13,7 +13,7 @@ export function isArchivedFile(item: EnteFile): boolean {return item.magicMetadata.data.visibility === ItemVisibility.archived;}-export function isArchivedCollection(item: Collection): boolean {+export const isArchivedCollection = (item: Collection) => {if (!item) {return false;}@@ -28,7 +28,7 @@ export function isArchivedCollection(item: Collection): boolean {);}return false;-}+};export function isPinnedCollection(item: Collection) {if (