mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 03:10: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
|
|
@ -7,7 +7,7 @@ import {
|
|||
useSetRecoilState,
|
||||
} from 'recoil';
|
||||
import type { TMessage, TPreset, TConversation, TSubmission } from 'librechat-data-provider';
|
||||
import type { TOptionSettings } from '~/common';
|
||||
import type { TOptionSettings, ExtendedFile } from '~/common';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
const conversationByIndex = atomFamily<TConversation | null, string | number>({
|
||||
|
|
@ -15,6 +15,11 @@ const conversationByIndex = atomFamily<TConversation | null, string | number>({
|
|||
default: null,
|
||||
});
|
||||
|
||||
const filesByIndex = atomFamily<Map<string, ExtendedFile>, string | number>({
|
||||
key: 'filesByIndex',
|
||||
default: new Map(),
|
||||
});
|
||||
|
||||
const conversationKeysAtom = atom<(string | number)[]>({
|
||||
key: 'conversationKeys',
|
||||
default: [],
|
||||
|
|
@ -99,6 +104,7 @@ function useCreateConversationAtom(key: string | number) {
|
|||
|
||||
export default {
|
||||
conversationByIndex,
|
||||
filesByIndex,
|
||||
presetByIndex,
|
||||
submissionByIndex,
|
||||
textByIndex,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue