Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fallback

Manav Rathie2cd1ea38029
diff --git a/web/apps/photos/src/components/Upload/Uploader.tsx b/web/apps/photos/src/components/Upload/Uploader.tsx
index f99b768ca9..fdc6ee9329 100644
--- a/web/apps/photos/src/components/Upload/Uploader.tsx
+++ b/web/apps/photos/src/components/Upload/Uploader.tsx
@@ -51,8 +51,6 @@ import { CollectionMappingChoiceModal } from "./CollectionMappingChoiceModal";
import UploadProgress from "./UploadProgress";
import UploadTypeSelector from "./UploadTypeSelector";
-const FIRST_ALBUM_NAME = "My First Album";
-
enum PICKED_UPLOAD_TYPE {
FILES = "files",
FOLDERS = "folders",
@@ -415,7 +413,9 @@ export default function Uploader({
}
if (isFirstUpload && !importSuggestion.rootFolderName) {
- importSuggestion.rootFolderName = FIRST_ALBUM_NAME;
+ importSuggestion.rootFolderName = t(
+ "autogenerated_first_album_name",
+ );
}
if (isDragAndDrop.current) {
@@ -714,7 +714,21 @@ export default function Uploader({
const didSelectCollectionMapping = (mapping: CollectionMapping) => {
switch (mapping) {
case "root":
- uploadToSingleNewCollection(importSuggestion.rootFolderName);
+ uploadToSingleNewCollection(
+ // rootFolderName would be empty here if one edge case:
+ // - User drags and drops a mixture of files and folders
+ // - They select the "upload to multiple albums" option
+ // - The see the error, close the error
+ // - Then they select the "upload to single album" option
+ //
+ // In such a flow, we'll reach here with an empty
+ // rootFolderName. The proper fix for this would be
+ // rearrange the flow and ask them to name the album here,
+ // but we currently don't have support for chaining modals.
+ // So in the meanwhile, keep a fallback album name at hand.
+ importSuggestion.rootFolderName ??
+ t("autogenerated_default_album_name"),
+ );
break;
case "parent":
if (importSuggestion.hasRootLevelFileWithFolder) {
diff --git a/web/packages/next/locales/en-US/translation.json b/web/packages/next/locales/en-US/translation.json
index 5fdb380d5b..b3debe5aa0 100644
--- a/web/packages/next/locales/en-US/translation.json
+++ b/web/packages/next/locales/en-US/translation.json
@@ -621,5 +621,7 @@
"PASSKEY_LOGIN_ERRORED": "An error occurred while logging in with passkey.",
"TRY_AGAIN": "Try again",
"PASSKEY_FOLLOW_THE_STEPS_FROM_YOUR_BROWSER": "Follow the steps from your browser to continue logging in.",
- "LOGIN_WITH_PASSKEY": "Login with passkey"
+ "LOGIN_WITH_PASSKEY": "Login with passkey",
+ "autogenerated_first_album_name": "My First Album",
+ "autogenerated_default_album_name": "New Album"
}