From c245c0feaa1850a851bb6a99e1361177c86ce129 Mon Sep 17 00:00:00 2001 From: Marc Itzenthaler Date: Fri, 17 Dec 2021 11:25:23 +0100 Subject: [PATCH] fix: elk stack log error fixed --- src/components/message/MessageItemComponent.tsx | 2 +- src/components/message/MessageUsername.tsx | 2 +- src/components/sessionHeader/SessionHeaderComponent.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/message/MessageItemComponent.tsx b/src/components/message/MessageItemComponent.tsx index c065959de..24291486c 100644 --- a/src/components/message/MessageItemComponent.tsx +++ b/src/components/message/MessageItemComponent.tsx @@ -176,7 +176,7 @@ export const MessageItemComponent = ({ (chatItem?.moderators && !chatItem?.moderators?.includes(userId)); const showForwardMessage = () => hasRenderedMessage && - activeSession.type !== SESSION_LIST_TYPES.ENQUIRY && + activeSession?.type !== SESSION_LIST_TYPES.ENQUIRY && chatItem?.feedbackGroupId && hasUserAuthority(AUTHORITIES.USE_FEEDBACK, userData) && !activeSession?.isFeedbackSession; diff --git a/src/components/message/MessageUsername.tsx b/src/components/message/MessageUsername.tsx index 6984233d3..67b604a24 100644 --- a/src/components/message/MessageUsername.tsx +++ b/src/components/message/MessageUsername.tsx @@ -65,7 +65,7 @@ export const MessageUsername = (props: MessageUsernameProps) => { <> {!props.alias && props.username && - chatItem.type !== SESSION_LIST_TYPES.ENQUIRY ? ( + chatItem?.type !== SESSION_LIST_TYPES.ENQUIRY ? (
diff --git a/src/components/sessionHeader/SessionHeaderComponent.tsx b/src/components/sessionHeader/SessionHeaderComponent.tsx index ec96f13c9..cebb62820 100644 --- a/src/components/sessionHeader/SessionHeaderComponent.tsx +++ b/src/components/sessionHeader/SessionHeaderComponent.tsx @@ -59,7 +59,7 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { let activeSession = getActiveSession(activeSessionGroupId, sessionsData); const isLiveChat = isAnonymousSession(activeSession?.session); const chatItem = getChatItemForSession(activeSession); - const consultingType = useConsultingType(chatItem.consultingType); + const consultingType = useConsultingType(chatItem?.consultingType); const username = getContact(activeSession).username; const userSessionData = getContact(activeSession).sessionData;