π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Inline
Manav Rathi8335c9ac7efb
diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsxindex d9a0670301..4d2120d8cd 100644--- a/web/apps/photos/src/components/FileList.tsx+++ b/web/apps/photos/src/components/FileList.tsx@@ -37,8 +37,7 @@ import {type ListChildComponentProps,areEqual,} from "react-window";-import type { SelectedState } from "types/gallery";-import { shouldShowAvatar } from "utils/file";+import { type SelectedState, shouldShowAvatar } from "utils/file";import {handleSelectCreator,handleSelectCreatorMulti,diff --git a/web/apps/photos/src/components/Upload.tsx b/web/apps/photos/src/components/Upload.tsxindex 1264eae2c4..6888c92b90 100644--- a/web/apps/photos/src/components/Upload.tsx+++ b/web/apps/photos/src/components/Upload.tsx@@ -83,7 +83,6 @@ import type {} from "services/upload-manager";import { uploadManager } from "services/upload-manager";import watcher from "services/watch";-import type { SetLoading } from "types/gallery";import { PublicCollectionGalleryContext } from "utils/publicCollectionGallery";import { UploadProgress } from "./UploadProgress";@@ -103,7 +102,7 @@ interface UploadProps {uploadTypeSelectorIntent: UploadTypeSelectorIntent;activeCollection?: Collection;closeUploadTypeSelector: () => void;- setLoading: SetLoading;+ setLoading: (loading: boolean) => void;setShouldDisableDropzone: (value: boolean) => void;showCollectionSelector?: () => void;/**diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsxindex a0db54a16a..1d4512b489 100644--- a/web/apps/photos/src/pages/gallery.tsx+++ b/web/apps/photos/src/pages/gallery.tsx@@ -121,8 +121,11 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";import type { FileWithPath } from "react-dropzone";import { Trans } from "react-i18next";import { uploadManager } from "services/upload-manager";-import type { SelectedState } from "types/gallery";-import { getSelectedFiles, performFileOp } from "utils/file";+import {+ getSelectedFiles,+ performFileOp,+ type SelectedState,+} from "utils/file";/*** The default view for logged in users.diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsxindex 9b2fe11689..1681367a9a 100644--- a/web/apps/photos/src/pages/shared-albums.tsx+++ b/web/apps/photos/src/pages/shared-albums.tsx@@ -87,8 +87,7 @@ import { useRouter } from "next/router";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { type FileWithPath } from "react-dropzone";import { uploadManager } from "services/upload-manager";-import type { SelectedState } from "types/gallery";-import { getSelectedFiles } from "utils/file";+import { getSelectedFiles, type SelectedState } from "utils/file";import { PublicCollectionGalleryContext } from "utils/publicCollectionGallery";export default function PublicCollectionGallery() {diff --git a/web/apps/photos/src/types/gallery/index.ts b/web/apps/photos/src/types/gallery/index.tsdeleted file mode 100644index 47f1f1c1b7..0000000000--- a/web/apps/photos/src/types/gallery/index.ts+++ /dev/null@@ -1,23 +0,0 @@-import { type SelectionContext } from "ente-new/photos/components/gallery";--export interface SelectedState {- [k: number]: boolean;- ownCount: number;- count: number;- collectionID: number;- /**- * The context in which the selection was made. Only set by newer code if- * there is an active selection (older code continues to rely on the- * {@link collectionID} logic).- */- context: SelectionContext | undefined;-}-export type SetSelectedState = React.Dispatch<- React.SetStateAction<SelectedState>->;-export type SetLoading = React.Dispatch<React.SetStateAction<boolean>>;--export interface MergedSourceURL {- original: string;- converted: string;-}diff --git a/web/apps/photos/src/utils/file/index.ts b/web/apps/photos/src/utils/file/index.tsindex b2d3199bb7..aefa842787 100644--- a/web/apps/photos/src/utils/file/index.ts+++ b/web/apps/photos/src/utils/file/index.ts@@ -3,6 +3,7 @@ import type { AddSaveGroup } from "ente-gallery/components/utils/save-groups";import { downloadAndSaveFiles } from "ente-gallery/services/save";import type { EnteFile } from "ente-media/file";import { ItemVisibility } from "ente-media/file-metadata";+import { type SelectionContext } from "ente-new/photos/components/gallery";import { type FileOp } from "ente-new/photos/components/SelectedFileOptions";import {addToFavoritesCollection,@@ -12,7 +13,22 @@ import {} from "ente-new/photos/services/collection";import { updateFilesVisibility } from "ente-new/photos/services/file";import { t } from "i18next";-import type { SelectedState } from "types/gallery";++export interface SelectedState {+ [k: number]: boolean;+ ownCount: number;+ count: number;+ collectionID: number;+ /**+ * The context in which the selection was made. Only set by newer code if+ * there is an active selection (older code continues to rely on the+ * {@link collectionID} logic).+ */+ context: SelectionContext | undefined;+}+export type SetSelectedState = React.Dispatch<+ React.SetStateAction<SelectedState>+>;export function getSelectedFiles(selected: SelectedState,diff --git a/web/apps/photos/src/utils/photoFrame/index.ts b/web/apps/photos/src/utils/photoFrame/index.tsindex 33e902cc6f..d5157febef 100644--- a/web/apps/photos/src/utils/photoFrame/index.ts+++ b/web/apps/photos/src/utils/photoFrame/index.ts@@ -1,6 +1,6 @@import type { SelectionContext } from "ente-new/photos/components/gallery";import type { GalleryBarMode } from "ente-new/photos/components/gallery/reducer";-import type { SelectedState, SetSelectedState } from "types/gallery";+import type { SelectedState, SetSelectedState } from "utils/file";// TODO: All this is unnecessarily complex, and needs reworking.export const handleSelectCreator =