[ADF-5358] - fixed duplicated type on reopening viewer (#6815)

This commit is contained in:
Vito
2021-03-18 09:28:59 +00:00
committed by GitHub
parent f90871da57
commit b0005c216b

View File

@@ -66,8 +66,9 @@ export class ContentTypePropertiesService {
}
private appendCurrentType(currentType: TypeEntry, contentTypesEntries: TypeEntry[]): TypeEntry[] {
const resultTypes = contentTypesEntries;
if (contentTypesEntries.indexOf(currentType) === -1) {
const resultTypes = [...contentTypesEntries];
const currentTypePresent = contentTypesEntries.find((type) => type.entry.id === currentType.entry.id);
if (!currentTypePresent) {
resultTypes.push(currentType);
}
return resultTypes;