fix: website crash when typing / followed with non prompt name (#262)
* fix: froward slash crash * added the rounded corners when editing folder/chat
This commit is contained in:
		
							parent
							
								
									cd49445491
								
							
						
					
					
						commit
						a70ae8799d
					
				|  | @ -107,11 +107,13 @@ export const ChatInput: FC<Props> = ({ | ||||||
| 
 | 
 | ||||||
|   const handleInitModal = () => { |   const handleInitModal = () => { | ||||||
|     const selectedPrompt = filteredPrompts[activePromptIndex]; |     const selectedPrompt = filteredPrompts[activePromptIndex]; | ||||||
|  |     if (selectedPrompt) { | ||||||
|       setContent((prevContent) => { |       setContent((prevContent) => { | ||||||
|         const newContent = prevContent?.replace(/\/\w*$/, selectedPrompt.content); |         const newContent = prevContent?.replace(/\/\w*$/, selectedPrompt.content); | ||||||
|         return newContent; |         return newContent; | ||||||
|       }); |       }); | ||||||
|       handlePromptSelect(selectedPrompt); |       handlePromptSelect(selectedPrompt); | ||||||
|  |     } | ||||||
|     setShowPromptList(false); |     setShowPromptList(false); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  | @ -209,8 +211,7 @@ export const ChatInput: FC<Props> = ({ | ||||||
|     if (textareaRef && textareaRef.current) { |     if (textareaRef && textareaRef.current) { | ||||||
|       textareaRef.current.style.height = 'inherit'; |       textareaRef.current.style.height = 'inherit'; | ||||||
|       textareaRef.current.style.height = `${textareaRef.current?.scrollHeight}px`; |       textareaRef.current.style.height = `${textareaRef.current?.scrollHeight}px`; | ||||||
|       textareaRef.current.style.overflow = `${ |       textareaRef.current.style.overflow = `${textareaRef?.current?.scrollHeight > 400 ? 'auto' : 'hidden' | ||||||
|         textareaRef?.current?.scrollHeight > 400 ? 'auto' : 'hidden' |  | ||||||
|         }`;
 |         }`;
 | ||||||
|     } |     } | ||||||
|   }, [content]); |   }, [content]); | ||||||
|  | @ -261,8 +262,7 @@ export const ChatInput: FC<Props> = ({ | ||||||
|               resize: 'none', |               resize: 'none', | ||||||
|               bottom: `${textareaRef?.current?.scrollHeight}px`, |               bottom: `${textareaRef?.current?.scrollHeight}px`, | ||||||
|               maxHeight: '400px', |               maxHeight: '400px', | ||||||
|               overflow: `${ |               overflow: `${textareaRef.current && textareaRef.current.scrollHeight > 400 | ||||||
|                 textareaRef.current && textareaRef.current.scrollHeight > 400 |  | ||||||
|                 ? 'auto' |                 ? 'auto' | ||||||
|                 : 'hidden' |                 : 'hidden' | ||||||
|                 }`,
 |                 }`,
 | ||||||
|  |  | ||||||
|  | @ -68,7 +68,7 @@ export const ConversationComponent: FC<Props> = ({ | ||||||
|   return ( |   return ( | ||||||
|     <div className="relative flex items-center"> |     <div className="relative flex items-center"> | ||||||
|       {isRenaming && selectedConversation.id === conversation.id ? ( |       {isRenaming && selectedConversation.id === conversation.id ? ( | ||||||
|         <div className="flex w-full items-center gap-3 bg-[#343541]/90 p-3"> |         <div className="flex w-full items-center gap-3 bg-[#343541]/90 p-3 rounded-lg"> | ||||||
|           <IconMessage size={18} /> |           <IconMessage size={18} /> | ||||||
|           <input |           <input | ||||||
|             className="mr-12 flex-1 overflow-hidden overflow-ellipsis border-neutral-400 bg-transparent text-left text-[12.5px] leading-3 text-white outline-none focus:border-neutral-100" |             className="mr-12 flex-1 overflow-hidden overflow-ellipsis border-neutral-400 bg-transparent text-left text-[12.5px] leading-3 text-white outline-none focus:border-neutral-100" | ||||||
|  |  | ||||||
|  | @ -103,7 +103,7 @@ export const ChatFolder: FC<Props> = ({ | ||||||
|     <> |     <> | ||||||
|       <div className="relative flex items-center"> |       <div className="relative flex items-center"> | ||||||
|         {isRenaming ? ( |         {isRenaming ? ( | ||||||
|           <div className="flex w-full items-center gap-3 bg-[#343541]/90 p-3"> |           <div className="flex w-full items-center gap-3 bg-[#343541]/90 p-3 rounded-lg"> | ||||||
|             {isOpen ? ( |             {isOpen ? ( | ||||||
|               <IconCaretDown size={18} /> |               <IconCaretDown size={18} /> | ||||||
|             ) : ( |             ) : ( | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue