From 2269403806e2e7bf0a8d27be2ba9d32e1a1af140 Mon Sep 17 00:00:00 2001 From: Danil Shishkevich <44939683+shishkevichd@users.noreply.github.com> Date: Mon, 27 Mar 2023 22:20:33 +0700 Subject: [PATCH] chore: fix styles in "OpenAI Key" div (#228) chore: do nothing if the name of the renamed dialog contains nothing. chore: fix some styles chore: remake conversation settings on mobile --- components/Chat/Chat.tsx | 6 +++--- components/Sidebar/Conversation.tsx | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/components/Chat/Chat.tsx b/components/Chat/Chat.tsx index 2c00092..04c572c 100644 --- a/components/Chat/Chat.tsx +++ b/components/Chat/Chat.tsx @@ -111,7 +111,7 @@ export const Chat: FC = memo(
{!(apiKey || serverSideApiKeyIsSet) ? (
-
+
@@ -201,8 +201,8 @@ export const Chat: FC = memo( />
{showSettings && ( -
-
+
+
= ({ }; const handleRename = (conversation: Conversation) => { - onUpdateConversation(conversation, { key: 'name', value: renameValue }); - setRenameValue(''); - setIsRenaming(false); + if (renameValue.trim().length > 0) { + onUpdateConversation(conversation, { key: 'name', value: renameValue }); + setRenameValue(''); + setIsRenaming(false); + } }; useEffect(() => { @@ -65,10 +67,10 @@ export const ConversationComponent: FC = ({ return (
{isRenaming && selectedConversation.id === conversation.id ? ( -
+
setRenameValue(e.target.value)} @@ -78,10 +80,10 @@ export const ConversationComponent: FC = ({
) : (