Merge pull request #2215 from NoelDeMartin/MOBILE-3040

MOBILE-3040 submission: Fix isSubmissionEmpty logic
main
Juan Leyva 2019-12-17 11:22:02 +01:00 committed by GitHub
commit 55c55f7ff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -193,7 +193,15 @@ export class AddonModAssignHelperProvider {
return true;
}
return !!submission.plugins.find((plugin) => this.submissionDelegate.isPluginEmpty(assign, plugin));
for (const plugin of submission.plugins) {
// If any plugin is not empty, we consider that the submission is not empty either.
if (!this.submissionDelegate.isPluginEmpty(assign, plugin)) {
return false;
}
}
// If all the plugins were empty (or there were no plugins), we consider the submission to be empty.
return true;
}
/**