mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
🛠️ refactor: Handle .webp, Improve File Life Cycle 📁 (#1213)
* fix: handle webp images correctly * refactor: use the userPath from the start of the filecycle to avoid handling the blob, whose loading may fail upon user request * refactor: delete temp files on reload and new chat
This commit is contained in:
parent
650759306d
commit
cc39074e0a
15 changed files with 160 additions and 66 deletions
|
|
@ -2,8 +2,9 @@ import { useState } from 'react';
|
|||
import { Settings } from 'lucide-react';
|
||||
import { EModelEndpoint } from 'librechat-data-provider';
|
||||
import type { FC } from 'react';
|
||||
import { useLocalize, useUserKey, useNewConvo, useOriginNavigate } from '~/hooks';
|
||||
import { useLocalize, useUserKey, useOriginNavigate } from '~/hooks';
|
||||
import { SetKeyDialog } from '~/components/Input/SetKeyDialog';
|
||||
import { useChatContext } from '~/Providers';
|
||||
import { icons } from './Icons';
|
||||
import { cn } from '~/utils';
|
||||
|
||||
|
|
@ -27,8 +28,8 @@ const MenuItem: FC<MenuItemProps> = ({
|
|||
}) => {
|
||||
const Icon = icons[endpoint] ?? icons.unknown;
|
||||
const [isDialogOpen, setDialogOpen] = useState(false);
|
||||
const { newConversation } = useChatContext();
|
||||
const { getExpiry } = useUserKey(endpoint);
|
||||
const { newConversation } = useNewConvo();
|
||||
const navigate = useOriginNavigate();
|
||||
const localize = useLocalize();
|
||||
const expiryTime = getExpiry();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue