From 127d1303d70394610af41629f41c2b83cefb0a06 Mon Sep 17 00:00:00 2001 From: Jack Schedel Date: Tue, 2 Jan 2024 13:32:39 -0500 Subject: [PATCH] generate button only on User sticky + not empty --- .../Chat/ChatContent/Message/MessageContent.tsx | 1 + .../Chat/ChatContent/Message/View/EditView.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/Chat/ChatContent/Message/MessageContent.tsx b/src/components/Chat/ChatContent/Message/MessageContent.tsx index 2ec56fb9..98ca9fab 100644 --- a/src/components/Chat/ChatContent/Message/MessageContent.tsx +++ b/src/components/Chat/ChatContent/Message/MessageContent.tsx @@ -26,6 +26,7 @@ const MessageContent = ({ setIsEdit={setIsEdit} messageIndex={messageIndex} sticky={sticky} + role={role} /> ) : ( >; messageIndex: number; sticky?: boolean; + role: string; }) => { const inputRole = useStore((state) => state.inputRole); const setChats = useStore((state) => state.setChats); @@ -145,6 +147,8 @@ const EditView = ({ cursorPosition={cursorPosition} _setContent={_setContent} messageIndex={messageIndex} + role={role} + content={content} /> {isModalOpen && ( void; @@ -177,6 +183,8 @@ const EditViewButtons = memo( cursorPosition: number; _setContent: React.Dispatch>; messageIndex: number; + role: string; + content: string; }) => { const { t } = useTranslation(); const generating = useStore.getState().generating; @@ -214,7 +222,7 @@ const EditViewButtons = memo( )} - {sticky || ( + {!sticky && role === 'user' && content != '' && (