π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Sublimate
Manav Rathi5eba06a269fa
diff --git a/web/apps/photos/src/components/Upload/Uploader.tsx b/web/apps/photos/src/components/Upload/Uploader.tsxindex f6bf01cf96..bde425d344 100644--- a/web/apps/photos/src/components/Upload/Uploader.tsx+++ b/web/apps/photos/src/components/Upload/Uploader.tsx@@ -24,7 +24,6 @@ import { firstNonEmpty } from "@/utils/array";import { CustomError } from "@ente/shared/error";import DiscFullIcon from "@mui/icons-material/DiscFull";import InfoRoundedIcon from "@mui/icons-material/InfoRounded";-import { UploadSelectorInputs } from "components/UploadSelectorInputs";import { t } from "i18next";import { GalleryContext } from "pages/gallery";import { useContext, useEffect, useRef, useState } from "react";@@ -213,6 +212,7 @@ export default function Uploader({} = useFileInput({directory: false,});+const {getInputProps: getFolderSelectorInputProps,openSelector: openFolderSelector,@@ -220,6 +220,7 @@ export default function Uploader({} = useFileInput({directory: true,});+const {getInputProps: getZipFileSelectorInputProps,openSelector: openZipFileSelector,@@ -713,7 +714,7 @@ export default function Uploader({} else if (type === PICKED_UPLOAD_TYPE.FOLDERS) {openFolderSelector();} else {- if (openZipFileSelector && electron) {+ if (electron) {openZipFileSelector();} else {showMiniDialog(downloadAppDialogAttributes());@@ -788,9 +789,8 @@ export default function Uploader({return (<>- <UploadSelectorInputs+ <Inputs{...{- // getDragAndDropInputProps,getFileSelectorInputProps,getFolderSelectorInputProps,getZipFileSelectorInputProps,@@ -833,6 +833,32 @@ export default function Uploader({);}+type GetInputProps = () => React.HTMLAttributes<HTMLInputElement>;++interface InputsProps {+ getFileSelectorInputProps: GetInputProps;+ getFolderSelectorInputProps: GetInputProps;+ getZipFileSelectorInputProps: GetInputProps;+}++/**+ * Create a bunch of HTML inputs elements, one each for the given props.+ *+ * These hidden input element serve as the way for us to show various file /+ * folder Selector dialogs and handle drag and drop inputs.+ */+const Inputs: React.FC<InputsProps> = ({+ getFileSelectorInputProps,+ getFolderSelectorInputProps,+ getZipFileSelectorInputProps,+}) => (+ <>+ <input {...getFileSelectorInputProps()} />+ <input {...getFolderSelectorInputProps()} />+ <input {...getZipFileSelectorInputProps()} />+ </>+);+const desktopFilesAndZipItems = async (electron: Electron, files: File[]) => {const fileAndPaths: FileAndPath[] = [];let zipItems: ZipItem[] = [];diff --git a/web/apps/photos/src/components/UploadSelectorInputs.tsx b/web/apps/photos/src/components/UploadSelectorInputs.tsxdeleted file mode 100644index d0720992ab..0000000000--- a/web/apps/photos/src/components/UploadSelectorInputs.tsx+++ /dev/null@@ -1,32 +0,0 @@-type GetInputProps = () => React.HTMLAttributes<HTMLInputElement>;--interface UploadSelectorInputsProps {- // getDragAndDropInputProps: GetInputProps;- getFileSelectorInputProps: GetInputProps;- getFolderSelectorInputProps: GetInputProps;- getZipFileSelectorInputProps?: GetInputProps;-}--/**- * Create a bunch of HTML inputs elements, one each for the given props.- *- * These hidden input element serve as the way for us to show various file /- * folder Selector dialogs and handle drag and drop inputs.- */-export const UploadSelectorInputs: React.FC<UploadSelectorInputsProps> = ({- // getDragAndDropInputProps,- getFileSelectorInputProps,- getFolderSelectorInputProps,- getZipFileSelectorInputProps,-}) => {- return (- <>- {/* <input {...getDragAndDropInputProps()} /> */}- <input {...getFileSelectorInputProps()} />- <input {...getFolderSelectorInputProps()} />- {getZipFileSelectorInputProps && (- <input {...getZipFileSelectorInputProps()} />- )}- </>- );-};diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsxindex 6f4b666c6f..b170192ca1 100644--- a/web/apps/photos/src/pages/shared-albums.tsx+++ b/web/apps/photos/src/pages/shared-albums.tsx@@ -23,7 +23,6 @@ import { useBaseContext } from "@/base/context";import { isHTTP401Error, PublicAlbumsCredentials } from "@/base/http";import log from "@/base/log";import { FullScreenDropZone } from "@/gallery/components/FullScreenDropZone";-import { useFileInput } from "@/gallery/components/utils/use-file-input";import { downloadManager } from "@/gallery/services/download";import { extractCollectionKeyFromShareURL } from "@/gallery/services/share";import { updateShouldDisableCFUploadProxy } from "@/gallery/services/upload";@@ -59,7 +58,6 @@ import {import PhotoFrame from "components/PhotoFrame";import { ITEM_TYPE, TimeStampListItem } from "components/PhotoList";import Uploader from "components/Upload/Uploader";-import { UploadSelectorInputs } from "components/UploadSelectorInputs";import { t } from "i18next";import { useRouter } from "next/router";import { useEffect, useMemo, useRef, useState } from "react";@@ -126,20 +124,6 @@ export default function PublicCollectionGallery() {noKeyboard: true,disabled: shouldDisableDropzone,});- const {- getInputProps: getFileSelectorInputProps,- openSelector: openFileSelector,- selectedFiles: fileSelectorFiles,- } = useFileInput({- directory: false,- });- const {- getInputProps: getFolderSelectorInputProps,- openSelector: openFolderSelector,- selectedFiles: folderSelectorFiles,- } = useFileInput({- directory: true,- });const [filesDownloadProgressAttributesList,@@ -507,13 +491,7 @@ export default function PublicCollectionGallery() {return (<PublicCollectionGalleryContext.Provider value={context}><FullScreenDropZone {...{ getDragAndDropRootProps }}>- <UploadSelectorInputs- {...{- getDragAndDropInputProps,- getFileSelectorInputProps,- getFolderSelectorInputProps,- }}- />+ <input {...getDragAndDropInputProps()} /><NavbarBasesx={{mb: "16px",@@ -570,10 +548,6 @@ export default function PublicCollectionGallery() {uploadTypeSelectorIntent="collect"{...{dragAndDropFiles,- openFileSelector,- fileSelectorFiles,- openFolderSelector,- folderSelectorFiles,}}/><FilesDownloadProgress