change useEffect watch state to acceptedFIles and prevent modal open when accpeted not loaded

This commit is contained in:
Abhinav-grd 2021-03-25 01:17:47 +05:30
parent bcc78e4f6f
commit ab56307bd2

View file

@ -50,11 +50,10 @@ export default function Upload(props: Props) {
props.collectionAndItsLatestFile &&
props.collectionAndItsLatestFile.length == 0
) {
props.closeCollectionSelector();
nextModal();
}
init();
}, [props.collectionSelectorView]);
}, [props.acceptedFiles]);
const init = () => {
setUploadStage(UPLOAD_STAGES.START);
@ -173,6 +172,9 @@ export default function Upload(props: Props) {
};
const nextModal = () => {
let fileAnalysisResult = analyseUploadFiles();
if (!fileAnalysisResult) {
return;
}
setTriggerFocus((prev) => !prev);
fileAnalysisResult.multipleFolders
? setChoiceModalView(true)