mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-24 04:10:15 +01:00
👷 fix: Minor Fixes and Refactors (#2388)
* refactor(useTextarea): set Textarea disabled message due to key higher in priority * fix(SidePanel): intended behavior for non-user provided keys * fix: generate specs * style: update combobox styling as before, with better dynamic height * chore: remove unused import
This commit is contained in:
parent
0fe47cf1f8
commit
c19dfddd0f
6 changed files with 136 additions and 75 deletions
|
|
@ -38,10 +38,10 @@ const SidePanel = ({
|
|||
const [fullCollapse, setFullCollapse] = useState(fullPanelCollapse);
|
||||
const [collapsedSize, setCollapsedSize] = useState(navCollapsedSize);
|
||||
const { data: endpointsConfig = {} as TEndpointsConfig } = useGetEndpointsQuery();
|
||||
const { data: keyExpiry = { expiresAt: undefined } } = useUserKeyQuery(EModelEndpoint.assistants);
|
||||
const isSmallScreen = useMediaQuery('(max-width: 767px)');
|
||||
const { conversation } = useChatContext();
|
||||
const { endpoint } = conversation ?? {};
|
||||
const { data: keyExpiry = { expiresAt: undefined } } = useUserKeyQuery(endpoint ?? '');
|
||||
|
||||
const panelRef = useRef<ImperativePanelHandle>(null);
|
||||
|
||||
|
|
@ -187,7 +187,11 @@ const SidePanel = ({
|
|||
isCollapsed ? 'h-[52px]' : 'px-2',
|
||||
)}
|
||||
>
|
||||
<Switcher isCollapsed={isCollapsed} endpointKeyProvided={keyProvided} />
|
||||
<Switcher
|
||||
isCollapsed={isCollapsed}
|
||||
endpointKeyProvided={keyProvided}
|
||||
endpoint={endpoint}
|
||||
/>
|
||||
<Separator className="bg-gray-100/50 dark:bg-gray-600" />
|
||||
</div>
|
||||
<Nav
|
||||
|
|
|
|||
|
|
@ -1,19 +1,13 @@
|
|||
import { EModelEndpoint } from 'librechat-data-provider';
|
||||
import type { SwitcherProps } from '~/common';
|
||||
import AssistantSwitcher from './AssistantSwitcher';
|
||||
import { useChatContext } from '~/Providers';
|
||||
import ModelSwitcher from './ModelSwitcher';
|
||||
|
||||
export default function Switcher(props: SwitcherProps) {
|
||||
const { conversation } = useChatContext();
|
||||
const { endpoint } = conversation ?? {};
|
||||
|
||||
if (!props.endpointKeyProvided) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (endpoint === EModelEndpoint.assistants) {
|
||||
if (props.endpoint === EModelEndpoint.assistants && props.endpointKeyProvided) {
|
||||
return <AssistantSwitcher {...props} />;
|
||||
} else if (props.endpoint === EModelEndpoint.assistants) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <ModelSwitcher {...props} />;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue