diff --git a/packages/ketcher-core/src/domain/entities/sgroup.ts b/packages/ketcher-core/src/domain/entities/sgroup.ts index 826b84e3c7..eab98aa0c6 100644 --- a/packages/ketcher-core/src/domain/entities/sgroup.ts +++ b/packages/ketcher-core/src/domain/entities/sgroup.ts @@ -632,7 +632,14 @@ export class SGroup { if (!sGroup) { return false } - return sGroup.type === 'SUP' + return sGroup.type === SGroup.TYPES.SUP + } + + static isDataSGroup(sGroup) { + if (!sGroup) { + return false + } + return sGroup.type === SGroup.TYPES.DAT } static isExpandedSGroup(sGroup) { diff --git a/packages/ketcher-react/src/script/ui/views/components/StructEditor/InfoPanel.tsx b/packages/ketcher-react/src/script/ui/views/components/StructEditor/InfoPanel.tsx index 9cb6728c1c..18657214a3 100644 --- a/packages/ketcher-react/src/script/ui/views/components/StructEditor/InfoPanel.tsx +++ b/packages/ketcher-react/src/script/ui/views/components/StructEditor/InfoPanel.tsx @@ -95,7 +95,7 @@ const InfoPanel: FC = (props) => { const groupName = sGroup?.data?.name useEffect(() => { - if (!groupStruct && sGroup?.type === 'DAT') { + if (SGroup.isDataSGroup(sGroup)) { setSGroupData(`${sGroup.data?.fieldName}=${sGroup.data?.fieldValue}`) } else { setSGroupData(null) @@ -119,7 +119,9 @@ const InfoPanel: FC = (props) => { const width = size.x const height = size.y - return molecule ? ( + const showMolecule = molecule && !SGroup.isDataSGroup(sGroup) + + return showMolecule ? (