[TLC-674] Properly test for existence of duplicates section

This commit is contained in:
Kim Shepherd
2024-02-29 11:06:03 +13:00
parent e76b6c962c
commit 1e36a10dd5
3 changed files with 2 additions and 12 deletions

View File

@@ -449,7 +449,7 @@ export class SubmissionObjectEffects {
// or if configuration overrides this behaviour
if (!alwaysDisplayDuplicates()) {
const duplicatesSectionId = findKey(currentState.sections, (section) => section.sectionType === SectionsType.Duplicates);
if (isNotUndefined(duplicatesSectionId) && isEmpty((sections[duplicatesSectionId] as WorkspaceitemSectionDuplicatesObject).potentialDuplicates)) {
if (isNotUndefined(duplicatesSectionId) && sections.hasOwnProperty(duplicatesSectionId) && isEmpty((sections[duplicatesSectionId] as WorkspaceitemSectionDuplicatesObject).potentialDuplicates)) {
mappedActions.push(new CleanDuplicateDetectionAction(submissionId));
}
}