Merge pull request #286 from ente-io/fix-multiple-folder-detection
fix multiple folder upload choices not showing up for sibling folder with no common ancestor
This commit is contained in:
commit
944aeaa479
|
@ -273,10 +273,14 @@ export default function Upload(props: Props) {
|
|||
};
|
||||
|
||||
const uploadToSingleNewCollection = (collectionName: string) => {
|
||||
if (collectionName) {
|
||||
uploadFilesToNewCollections(
|
||||
UPLOAD_STRATEGY.SINGLE_COLLECTION,
|
||||
collectionName
|
||||
);
|
||||
} else {
|
||||
showCollectionCreateModal(analysisResult);
|
||||
}
|
||||
};
|
||||
const showCollectionCreateModal = (analysisResult: AnalysisResult) => {
|
||||
props.setCollectionNamerAttributes({
|
||||
|
@ -291,25 +295,23 @@ export default function Upload(props: Props) {
|
|||
analysisResult: AnalysisResult,
|
||||
isFirstUpload: boolean
|
||||
) => {
|
||||
if (!analysisResult.suggestedCollectionName) {
|
||||
if (isFirstUpload) {
|
||||
uploadToSingleNewCollection(FIRST_ALBUM_NAME);
|
||||
} else {
|
||||
props.setCollectionSelectorAttributes({
|
||||
callback: uploadFilesToExistingCollection,
|
||||
showNextModal: () =>
|
||||
showCollectionCreateModal(analysisResult),
|
||||
title: constants.UPLOAD_TO_COLLECTION,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let showNextModal = () => {};
|
||||
if (analysisResult.multipleFolders) {
|
||||
setChoiceModalView(true);
|
||||
} else if (analysisResult.suggestedCollectionName) {
|
||||
showNextModal = () => setChoiceModalView(true);
|
||||
} else {
|
||||
showNextModal = () =>
|
||||
uploadToSingleNewCollection(
|
||||
analysisResult.suggestedCollectionName
|
||||
);
|
||||
}
|
||||
props.setCollectionSelectorAttributes({
|
||||
callback: uploadFilesToExistingCollection,
|
||||
showNextModal,
|
||||
title: constants.UPLOAD_TO_COLLECTION,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue