Fix importStudies dialog when import fails (#223)
If an import happens to fail the dialog promise never resolves. This is because `numberOfStudiesFailed` is incremented on error but `numberOfStudiesImported` is not, so the branch to resolve or reject is never taken.
This commit is contained in:
parent
37ef5dc3df
commit
7849699a0d
@ -104,7 +104,7 @@ const importStudiesInternal = (studiesToImport, dialog) => {
|
||||
const { numberOfStudiesImported, numberOfStudiesFailed } = studyImportStatus;
|
||||
dialog.update(numberOfStudiesImported);
|
||||
|
||||
if (numberOfStudiesImported === numberOfStudies) {
|
||||
if ((numberOfStudiesImported + numberOfStudiesFailed) === numberOfStudies) {
|
||||
// The entire import operation is completed, so remove the study import status item
|
||||
Meteor.call('removeStudyImportStatus', studyImportStatus._id);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user