This commit is contained in:
Manav Rathi 2024-04-30 11:50:15 +05:30
parent 8ee9b2be32
commit ab95b4daee
No known key found for this signature in database

View file

@ -209,6 +209,7 @@ export default function Uploader({
setChoiceModalView(false); setChoiceModalView(false);
uploadRunning.current = false; uploadRunning.current = false;
}; };
const handleCollectionSelectorCancel = () => { const handleCollectionSelectorCancel = () => {
uploadRunning.current = false; uploadRunning.current = false;
}; };
@ -234,6 +235,7 @@ export default function Uploader({
publicCollectionGalleryContext, publicCollectionGalleryContext,
appContext.isCFProxyDisabled, appContext.isCFProxyDisabled,
); );
if (uploadManager.isUploadRunning()) { if (uploadManager.isUploadRunning()) {
setUploadProgressView(true); setUploadProgressView(true);
} }
@ -709,28 +711,19 @@ export default function Uploader({
} }
}; };
const handleUploadToSingleCollection = () => {
uploadToSingleNewCollection(importSuggestion.rootFolderName);
};
const handleUploadToMultipleCollections = () => {
if (importSuggestion.hasRootLevelFileWithFolder) {
appContext.setDialogMessage(
getRootLevelFileWithFolderNotAllowMessage(),
);
return;
}
uploadFilesToNewCollections("parent");
};
const didSelectCollectionMapping = (mapping: CollectionMapping) => { const didSelectCollectionMapping = (mapping: CollectionMapping) => {
switch (mapping) { switch (mapping) {
case "root": case "root":
handleUploadToSingleCollection(); uploadToSingleNewCollection(importSuggestion.rootFolderName);
break; break;
case "parent": case "parent":
handleUploadToMultipleCollections(); if (importSuggestion.hasRootLevelFileWithFolder) {
break; appContext.setDialogMessage(
getRootLevelFileWithFolderNotAllowMessage(),
);
} else {
uploadFilesToNewCollections("parent");
}
} }
}; };