Skip to content

Commit

Permalink
#2717 remove conditional from isDataSGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinEpam23 committed May 31, 2023
1 parent c0ac2a8 commit 9d255b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions packages/ketcher-core/src/domain/entities/sgroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,13 +632,10 @@ export class SGroup {
if (!sGroup) {
return false
}
return sGroup.type === SGroup.TYPES.SUP
return sGroup?.type === SGroup.TYPES.SUP
}

static isDataSGroup(sGroup: SGroup): boolean {
if (!sGroup) {
return false
}
return sGroup.type === SGroup.TYPES.DAT
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const InfoPanel: FC<InfoPanelProps> = (props) => {
const width = size.x
const height = size.y

const showMolecule = molecule && !SGroup.isDataSGroup(sGroup)
const showMolecule = molecule && sGroup && !SGroup.isDataSGroup(sGroup)

return showMolecule ? (
<div
Expand Down

0 comments on commit 9d255b4

Please sign in to comment.