mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-23 02:36:12 +01:00
fix : endpoint option should hide on exist conversation
This commit is contained in:
parent
ec47879edc
commit
5cb59885ec
3 changed files with 23 additions and 65 deletions
|
|
@ -8,7 +8,7 @@ import store from '~/store';
|
|||
function OpenAIOptions() {
|
||||
const [advancedMode, setAdvancedMode] = useState(false);
|
||||
const [conversation, setConversation] = useRecoilState(store.conversation) || {};
|
||||
const { endpoint } = conversation;
|
||||
const { endpoint, conversationId } = conversation;
|
||||
|
||||
const triggerAdvancedMode = () => setAdvancedMode(prev => !prev);
|
||||
|
||||
|
|
@ -47,6 +47,7 @@ function OpenAIOptions() {
|
|||
}, [conversation, advancedMode]);
|
||||
|
||||
if (endpoint !== 'openAI') return null;
|
||||
if (conversationId !== 'new') return null;
|
||||
|
||||
const { model } = conversation;
|
||||
|
||||
|
|
@ -83,22 +84,28 @@ function OpenAIOptions() {
|
|||
</div>
|
||||
<div
|
||||
className={
|
||||
cardStyle +
|
||||
' p-b-[40px] openAIOptions-advanced-container absolute left-4 right-4 bottom-[40px] flex flex-col overflow-hidden rounded-md bg-slate-100 bg-white px-0' +
|
||||
' openAIOptions-advanced-container absolute bottom-[-10px] flex w-full flex-col items-center justify-center px-4' +
|
||||
(advancedMode ? ' show' : '')
|
||||
}
|
||||
>
|
||||
<div className="flex w-full items-center justify-between bg-slate-100 px-4 py-2 dark:bg-white/10">
|
||||
<span className="text-xs font-medium font-normal">Advanced settings for OpenAI endpoint</span>
|
||||
<Button
|
||||
type="button"
|
||||
className="h-auto bg-transparent px-2 py-1 text-xs font-medium font-normal text-black hover:bg-slate-200 hover:text-black dark:bg-transparent dark:text-white dark:hover:bg-gray-700 dark:hover:text-white"
|
||||
onClick={switchToSimpleMode}
|
||||
>
|
||||
Switch to simple mode
|
||||
</Button>
|
||||
<div
|
||||
className={
|
||||
cardStyle +
|
||||
' flex w-full flex-col overflow-hidden rounded-md border bg-slate-200 px-0 pb-[10px] dark:border-white/10 lg:w-[736px]'
|
||||
}
|
||||
>
|
||||
<div className="flex w-full items-center justify-between bg-slate-100 px-4 py-2 dark:bg-gray-800/60">
|
||||
<span className="text-xs font-medium font-normal">Advanced settings for OpenAI endpoint</span>
|
||||
<Button
|
||||
type="button"
|
||||
className="h-auto bg-transparent px-2 py-1 text-xs font-medium font-normal text-black hover:bg-slate-200 hover:text-black dark:bg-transparent dark:text-white dark:hover:bg-gray-700 dark:hover:text-white"
|
||||
onClick={switchToSimpleMode}
|
||||
>
|
||||
Switch to simple mode
|
||||
</Button>
|
||||
</div>
|
||||
<div className="h-[200px]">content</div>
|
||||
</div>
|
||||
<div className="h-[200px]">content</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue