Skip to content

armgit / ente

Public Imported from GitHub
0

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

Deeper

Manav Rathibf3d04fc12c5
diff --git a/web/apps/photos/src/components/Upload/Uploader.tsx b/web/apps/photos/src/components/Upload/Uploader.tsx
index c909aff662..d72533a434 100644
--- a/web/apps/photos/src/components/Upload/Uploader.tsx
+++ b/web/apps/photos/src/components/Upload/Uploader.tsx
@@ -436,7 +436,7 @@ export default function Uploader(props: Props) {
const collections: Collection[] = [];
let collectionNameToFilesMap = new Map<
string,
- (File | ElectronFile)[]
+ File[] | ElectronFile[] | string[]
>();
if (strategy == "root") {
collectionNameToFilesMap.set(
diff --git a/web/apps/photos/src/utils/upload/index.ts b/web/apps/photos/src/utils/upload/index.ts
index e7474697b3..87d885c274 100644
--- a/web/apps/photos/src/utils/upload/index.ts
+++ b/web/apps/photos/src/utils/upload/index.ts
@@ -176,11 +176,15 @@ export function getImportSuggestion(
// b => [e,f,g],
// c => [h, i]]
export function groupFilesBasedOnParentFolder(
- toUploadFiles: File[] | ElectronFile[],
+ toUploadFiles: File[] | ElectronFile[] | string[],
) {
- const collectionNameToFilesMap = new Map<string, (File | ElectronFile)[]>();
+ const collectionNameToFilesMap = new Map<
+ string,
+ File[] | ElectronFile[] | string[]
+ >();
for (const file of toUploadFiles) {
- const filePath = file["path"] as string;
+ const filePath =
+ typeof file == "string" ? file : (file["path"] as string);
let folderPath = filePath.substring(0, filePath.lastIndexOf("/"));
// If the parent folder of a file is "metadata"