From b3511e89e7efce73722a277143f008665e92a97f Mon Sep 17 00:00:00 2001 From: Konstantin Levin Date: Wed, 31 May 2023 15:17:31 +0200 Subject: [PATCH] #2717 Add types --- packages/ketcher-core/src/domain/entities/sgroup.ts | 4 ++-- .../src/script/ui/views/components/StructEditor/InfoPanel.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ketcher-core/src/domain/entities/sgroup.ts b/packages/ketcher-core/src/domain/entities/sgroup.ts index eab98aa0c6..d1c5c57e89 100644 --- a/packages/ketcher-core/src/domain/entities/sgroup.ts +++ b/packages/ketcher-core/src/domain/entities/sgroup.ts @@ -628,14 +628,14 @@ export class SGroup { }) } - static isSuperAtom(sGroup) { + static isSuperAtom(sGroup: SGroup): boolean { if (!sGroup) { return false } return sGroup.type === SGroup.TYPES.SUP } - static isDataSGroup(sGroup) { + static isDataSGroup(sGroup: SGroup): boolean { if (!sGroup) { return false } 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 18657214a3..93bc2a7408 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 (SGroup.isDataSGroup(sGroup)) { + if (sGroup && SGroup.isDataSGroup(sGroup)) { setSGroupData(`${sGroup.data?.fieldName}=${sGroup.data?.fieldValue}`) } else { setSGroupData(null)