diff --git a/web/chat/message-preview.react.js b/web/chat/message-preview.react.js --- a/web/chat/message-preview.react.js +++ b/web/chat/message-preview.react.js @@ -35,10 +35,13 @@ ); } - const messageInfo: ComposableMessageInfo | RobotextMessageInfo = - messageInfoProps.type === messageTypes.SIDEBAR_SOURCE - ? messageInfoProps.sourceMessage - : messageInfoProps; + + let messageInfo: ComposableMessageInfo | RobotextMessageInfo; + if (messageInfoProps.type === messageTypes.SIDEBAR_SOURCE) { + messageInfo = messageInfoProps.sourceMessage; + } else { + messageInfo = messageInfoProps; + } const messageTitle = getMessageTitle( messageInfo,